eZ\Bundle\EzPublishCoreBundle\Tests\DependencyInjection\Configuration\SiteAccessAware\ConfigurationProcessorTest::testMapConfigMapperObject PHP Метод

testMapConfigMapperObject() публичный Метод

    public function testMapConfigMapperObject()
    {
        $namespace = 'ez_test';
        $saNodeName = 'foo';
        $container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface');
        $processor = new ConfigurationProcessor($container, $namespace, $saNodeName);
        $contextualizer = $processor->getContextualizer();
        $sa1Name = 'sa1';
        $sa2Name = 'sa2';
        $sa1Config = array('foo' => 'bar', 'hello' => 'world', 'an_integer' => 123, 'a_bool' => true);
        $sa2Config = array('foo' => 'bar2', 'hello' => 'universe', 'an_integer' => 456, 'a_bool' => false);
        $config = array('not_sa_aware' => 'blabla', $saNodeName => array('sa1' => $sa1Config, 'sa2' => $sa2Config));
        $mapper = $this->getMock('eZ\\Bundle\\EzPublishCoreBundle\\DependencyInjection\\Configuration\\SiteAccessAware\\ConfigurationMapperInterface');
        $mapper->expects($this->exactly(count($config[$saNodeName])))->method('mapConfig')->will($this->returnValueMap(array(array($sa1Config, $sa1Name, $contextualizer, null), array($sa2Config, $sa2Name, $contextualizer, null))));
        $processor->mapConfig($config, $mapper);
    }