Kévin Dunglas
Inheritance: implements Symfony\Component\Routing\RouterInterface, implements ApiPlatform\Core\Api\UrlGeneratorInterface
コード例 #1
0
ファイル: RouterTest.php プロジェクト: api-platform/core
 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'));
 }