eZ\Bundle\EzPublishCoreBundle\EventListener\DynamicSettingsListener::setContainer PHP Method

setContainer() public method

public setContainer ( Symfony\Component\DependencyInjection\ContainerInterface $container )
$container Symfony\Component\DependencyInjection\ContainerInterface
    public function setContainer(ContainerInterface $container)
    {
        $this->container = $container;
    }

Usage Example

 public function testOnConfigScopeChange()
 {
     $siteAccess = new SiteAccess('test');
     $event = new ScopeChangeEvent($siteAccess);
     $resettableServices = array('foo', 'bar.baz');
     $dynamicSettingsServiceIds = array('something', 'something_else');
     $this->container->expects($this->at(0))->method('set')->with('foo', null);
     $this->container->expects($this->at(1))->method('set')->with('bar.baz', null);
     $fakeService1 = new \stdClass();
     $this->container->expects($this->at(2))->method('set')->with('something', null);
     $this->container->expects($this->at(3))->method('get')->with('something')->will($this->returnValue($fakeService1));
     $this->container->expects($this->at(4))->method('set')->with('something', $fakeService1);
     $fakeService2 = new \stdClass();
     $this->container->expects($this->at(5))->method('set')->with('something_else', null);
     $this->container->expects($this->at(6))->method('get')->with('something_else')->will($this->returnValue($fakeService2));
     $this->container->expects($this->at(7))->method('set')->with('something_else', $fakeService2);
     $listener = new DynamicSettingsListener($resettableServices, $dynamicSettingsServiceIds);
     $listener->setContainer($this->container);
     $listener->onConfigScopeChange($event);
     $this->assertSame($siteAccess, $event->getSiteAccess());
 }
All Usage Examples Of eZ\Bundle\EzPublishCoreBundle\EventListener\DynamicSettingsListener::setContainer