/** * @test */ public function shouldFindRouteRulePut() { //given Route::put('/user/index', 'user#index'); $router = $this->_createRouter('PUT', '/user/index'); //when $rule = $router->findRoute(); //then $this->assertEquals('/user/index', $rule->getUri()); $this->assertEquals('PUT', $rule->getMethod()); $this->assertEquals('user', $rule->getController()); $this->assertEquals('index', $rule->getAction()); }
/** * @test */ public function shouldAddPutRoute() { //given Route::put('/users/save', 'users#save'); //when $routes = Route::getRoutes(); //then $this->assertEquals('users', $routes[0]->getController()); $this->assertEquals('save', $routes[0]->getAction()); }