ApiPlatform\Core\Bridge\Symfony\Routing\Router::getContext PHP Method

getContext() public method

public getContext ( )
    public function getContext()
    {
        return $this->router->getContext();
    }

Usage Example

コード例 #1
0
ファイル: RouterTest.php プロジェクト: api-platform/core
 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());
 }