Symfony\Bundle\SecurityBundle\Security\FirewallContext::getContext PHP Method

getContext() public method

Deprecation: since version 3.3, will be removed in 4.0. Use {@link getListeners()} instead.
public getContext ( )
    public function getContext()
    {
        @trigger_error(sprintf('Method %s() is deprecated since version 3.3 and will be removed in 4.0. Use %s::getListeners() instead.', __METHOD__, __CLASS__), E_USER_DEPRECATED);
        return $this->getListeners();
    }

Usage Example

コード例 #1
0
 public function testGetters()
 {
     $config = $this->getMockBuilder(FirewallConfig::class)->disableOriginalConstructor()->getMock();
     $exceptionListener = $this->getMockBuilder(ExceptionListener::class)->disableOriginalConstructor()->getMock();
     $listeners = array($this->getMockBuilder(ListenerInterface::class)->disableOriginalConstructor()->getMock());
     $context = new FirewallContext($listeners, $exceptionListener, $config);
     $this->assertEquals(array($listeners, $exceptionListener), $context->getContext());
     $this->assertEquals($config, $context->getConfig());
 }