コード例 #1
0
 public function testAutomaticRouteNamesDoNotConflict()
 {
     $routes = new RouteCollectionBuilder();
     $adminRoutes = $routes->createBuilder();
     // route 1
     $adminRoutes->add('/dashboard', '');
     $accountRoutes = $routes->createBuilder();
     // route 2
     $accountRoutes->add('/dashboard', '')->setMethods(array('GET'));
     // route 3
     $accountRoutes->add('/dashboard', '')->setMethods(array('POST'));
     $routes->mount('/admin', $adminRoutes);
     $routes->mount('/account', $accountRoutes);
     $collection = $routes->build();
     // there are 2 routes (i.e. with non-conflicting names)
     $this->assertCount(3, $collection->all());
 }