function it_creates_routes_with_multiple_method_types(Router $router, RouteCreator $creator) { $f = function () { echo 'test'; }; $creator->getRouteInfo()->willReturn(array(array('method' => array('get', 'post'), 'uri' => 'test', 'action' => $f))); $this->create($creator); $router->match(array('get', 'post'), 'test', $f)->shouldBeCalled(); }
/** * Create the route based on how the default Application wants to do routes. * * @param string|array $method * @param string $uri * @param string|array|Callable $action */ protected function makeRoute($method, $uri, $action) { if (is_array($method)) { $this->router->match($method, $uri, $action); } else { $f = $this->getMethodName($method); $this->router->{$f}($uri, $action); } }