예제 #1
0
파일: RouterTest.php 프로젝트: lucidphp/mux
 /** @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());
     }
 }