/** * Determine what methods a route responds to * * @param Route $route * @param int $index */ protected function registerRouteMethods(Route $route, $index) { foreach ($route->respondsTo() as $method) { if (!isset($this->routesByMethod[$method])) { $this->routesByMethod[$method] = []; } $this->routesByMethod[$method][$index] = $route; } }
public function testCanSpecifyAdditionalMethodTypesToRespondTo() { Route::allowMethod(__FUNCTION__); $map = $this->app->map('/:controller', 'bogus-callback'); $map->via(__FUNCTION__); $this->assertTrue($map->respondsTo(__FUNCTION__)); }