ApiPlatform\Core\Tests\Bridge\Symfony\Routing\RouterTest::testContextAccessor PHP Method

testContextAccessor() public method

public testContextAccessor ( )
    public function testContextAccessor()
    {
        $context = new RequestContext();
        $mockedRouter = $this->prophesize('Symfony\\Component\\Routing\\RouterInterface');
        $mockedRouter->setContext($context)->shouldBeCalled();
        $mockedRouter->getContext()->willReturn($context)->shouldBeCalled();
        $router = new Router($mockedRouter->reveal());
        $router->setContext($context);
        $this->assertSame($context, $router->getContext());
    }