File tree 2 files changed +39
-0
lines changed
Fixtures/Resources/Routing 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ app_home :
2
+ path : /
3
+
4
+ app_blog :
5
+ path : /blog
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Nyholm \BundleTest \Tests \Functional ;
4
+
5
+ use Nyholm \BundleTest \BaseBundleTestCase ;
6
+ use Symfony \Bundle \FrameworkBundle \FrameworkBundle ;
7
+ use Symfony \Component \Routing \RouterInterface ;
8
+
9
+ class BundleRoutingTest extends BaseBundleTestCase
10
+ {
11
+ public function testSetRoutingFile ()
12
+ {
13
+ $ this ->setRoutingFile (__DIR__ .'/../Fixtures/Resources/Routing/routes.yml ' );
14
+
15
+ $ this ->bootKernel ();
16
+ $ container = $ this ->getContainer ();
17
+ $ container = $ container ->get ('test.service_container ' );
18
+ /**
19
+ * @var RouterInterface $router
20
+ */
21
+ $ router = $ container ->get (RouterInterface::class);
22
+ $ routeCollection = $ router ->getRouteCollection ();
23
+ $ routes = $ routeCollection ->all ();
24
+
25
+ $ this ->assertCount (2 , $ routes );
26
+ $ this ->assertNotNull ($ routeCollection ->get ('app_home ' ));
27
+ $ this ->assertNotNull ($ routeCollection ->get ('app_blog ' ));
28
+ }
29
+
30
+ protected function getBundleClass ()
31
+ {
32
+ return FrameworkBundle::class;
33
+ }
34
+ }
You can’t perform that action at this time.
0 commit comments