ApiPlatform\Core\Tests\Bridge\Symfony\Routing\RouterTest::testMatch PHP 메소드

testMatch() 공개 메소드

public testMatch ( )
    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'));
    }