group() public static method

public static group ( $name, $routeFunction )
Ejemplo n.º 1
0
 /**
  * @test
  */
 public function shouldAddRouteInGroup()
 {
     //given
     Route::group('api', function () {
         GroupedRoute::post('/users/:id/archive', 'users#archive');
     });
     //when
     $routes = Route::getRoutes();
     //then
     $this->assertCount(1, $routes);
     $this->assertEquals('/api/users/:id/archive', $routes[0]->getUri());
     $this->assertEquals('archive', $routes[0]->getAction());
     $this->assertEquals('api/users', $routes[0]->getController());
     $this->assertEquals('POST', $routes[0]->getMethod());
 }