public function testRouteInvalidController() { // Set routes $route = new Route('/{controller}/{action}', [], ['controller' => '[a-z-]+', 'action' => '[a-z-]+']); $this->router->addRoute($route); // Route request $request = Request::create('/index/some-other'); $this->setExpectedException('\\Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException'); $this->router->route($request); }