/** @test */ public function itShouldThrowOnNoneMatchingRequest() { $req = new Request('/foo'); $router = new Router($routes = $this->mockRoutes(), $matcher = $this->mockMatcher()); $matcher->expects($this->once())->method('matchRequest')->with($req, $routes)->willReturn($this->mockMatch(false)); try { $router->dispatch($req); } catch (MatchException $e) { $this->assertEquals('No route found for requested resource "/foo".', $e->getMessage()); } }