match() 공개 메소드

public match ( $pathInfo )
예제 #1
0
 public function testMatch()
 {
     $context = new RequestContext('/app_dev.php', 'GET', 'localhost', 'https');
     $mockedRouter = $this->prophesize('Symfony\\Component\\Routing\\RouterInterface');
     $mockedRouter->getContext()->willReturn($context)->shouldBeCalled();
     $mockedRouter->setContext(Argument::type('Symfony\\Component\\Routing\\RequestContext'))->shouldBeCalled();
     $mockedRouter->setContext($context)->shouldBeCalled();
     $mockedRouter->match('/foo')->willReturn(['bar'])->shouldBeCalled();
     $router = new Router($mockedRouter->reveal());
     $this->assertEquals(['bar'], $router->match('/app_dev.php/foo'));
 }