eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\ConfigurationProcessor::setContextualizer PHP Method

setContextualizer() public method

public setContextualizer ( eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\ContextualizerInterface $contextualizer )
$contextualizer eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\ContextualizerInterface
    public function setContextualizer(ContextualizerInterface $contextualizer)
    {
        $this->contextualizer = $contextualizer;
    }

Usage Example

コード例 #1
0
 public function testMapConfigArray()
 {
     $namespace = 'ez_test';
     $saNodeName = 'foo';
     $container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface');
     $processor = new ConfigurationProcessor($container, $namespace, $saNodeName);
     $contextualizer = $this->getMock('eZ\\Bundle\\EzPublishCoreBundle\\DependencyInjection\\Configuration\\SiteAccessAware\\ContextualizerInterface');
     $processor->setContextualizer($contextualizer);
     $sa1Config = array('foo' => 'bar', 'hello' => array('world'), 'an_integer' => 123, 'a_bool' => true);
     $sa2Config = array('foo' => 'bar2', 'hello' => array('universe'), 'an_integer' => 456, 'a_bool' => false);
     $config = array('not_sa_aware' => 'blabla', $saNodeName => array('sa1' => $sa1Config, 'sa2' => $sa2Config));
     $contextualizer->expects($this->once())->method('mapConfigArray')->with('hello', $config, ContextualizerInterface::MERGE_FROM_SECOND_LEVEL);
     $processor->mapConfigArray('hello', $config, ContextualizerInterface::MERGE_FROM_SECOND_LEVEL);
 }