File tree 2 files changed +16
-3
lines changed
src/Symfony/Component/Routing
2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -312,10 +312,10 @@ public function build()
312
312
313
313
$ routeCollection ->addCollection ($ subCollection );
314
314
}
315
+ }
315
316
316
- foreach ($ this ->resources as $ resource ) {
317
- $ routeCollection ->addResource ($ resource );
318
- }
317
+ foreach ($ this ->resources as $ resource ) {
318
+ $ routeCollection ->addResource ($ resource );
319
319
}
320
320
321
321
return $ routeCollection ;
Original file line number Diff line number Diff line change 12
12
namespace Symfony \Component \Routing \Tests ;
13
13
14
14
use PHPUnit \Framework \TestCase ;
15
+ use Symfony \Component \Config \FileLocator ;
15
16
use Symfony \Component \Config \Resource \FileResource ;
17
+ use Symfony \Component \Routing \Loader \YamlFileLoader ;
16
18
use Symfony \Component \Routing \Route ;
17
19
use Symfony \Component \Routing \RouteCollection ;
18
20
use Symfony \Component \Routing \RouteCollectionBuilder ;
@@ -59,7 +61,18 @@ public function testImport()
59
61
$ this ->assertCount (1 , $ addedCollection ->getResources ());
60
62
61
63
// make sure the routes were imported into the top-level builder
64
+ $ routeCollection = $ routes ->build ();
62
65
$ this ->assertCount (1 , $ routes ->build ());
66
+ $ this ->assertCount (1 , $ routeCollection ->getResources ());
67
+ }
68
+
69
+ public function testImportAddResources ()
70
+ {
71
+ $ routeCollectionBuilder = new RouteCollectionBuilder (new YamlFileLoader (new FileLocator (array (__DIR__ .'/Fixtures/ ' ))));
72
+ $ routeCollectionBuilder ->import ('file_resource.yml ' );
73
+ $ routeCollection = $ routeCollectionBuilder ->build ();
74
+
75
+ $ this ->assertCount (1 , $ routeCollection ->getResources ());
63
76
}
64
77
65
78
/**
You can’t perform that action at this time.
0 commit comments