Contao\CoreBundle\Routing\UrlGenerator::setContext PHP Method

setContext() public method

public setContext ( Symfony\Component\Routing\RequestContext $context )
$context Symfony\Component\Routing\RequestContext
    public function setContext(RequestContext $context)
    {
        $this->router->setContext($context);
    }

Usage Example

 /**
  * Tests the setContext() method.
  */
 public function testSetContext()
 {
     $generator = new UrlGenerator(new ParentUrlGenerator(new RouteCollection(), new RequestContext()), $this->mockContaoFramework(), false);
     $context = new RequestContext();
     $generator->setContext($context);
     $this->assertSame($context, $generator->getContext());
 }