public function testRoutes() { foreach ($this->requestParams as $requestParam) { $request = $this->getRequest($requestParam['uri'], $requestParam['method']); $route = $this->router->match($request); $this->assertFalse(is_array($route)); $this->assertTrue($route instanceof Route); $this->assertTrue($route->routeName == $requestParam['name']); } }
/** * Dispatches a not found route if it exists or hands it off to the built in error page * * @throws Http\Router\MethodNotAllowedException */ private function dispatchNotFound() { if ($this->router->offsetExists("404")) { $notFoundRoute = $this->router->getItem('404'); Dispatcher::handle($notFoundRoute, $this->request, $this->container); } else { $this->genericNotFound(); } }