Author: Fabien Potencier (fabien.potencier@symfony-project.com)
Inheritance: extends Symfony\Component\DependencyInjection\Extension\Extension
Example #1
0
 public function testLoggerLoad()
 {
     $configuration = new BuilderConfiguration();
     $loader = new ZendExtension();
     $configuration = $loader->loggerLoad(array(), $configuration);
     $this->assertEquals('Symfony\\Bundle\\ZendBundle\\Logger\\Logger', $configuration->getParameter('zend.logger.class'), '->loggerLoad() loads the logger.xml file if not already loaded');
     $configuration = $loader->loggerLoad(array('priority' => 3), $configuration);
     $this->assertEquals(3, $configuration->getParameter('zend.logger.priority'), '->loggerLoad() overrides existing configuration options');
 }
Example #2
0
 public function testI18nLoad()
 {
     $container = new ContainerBuilder();
     $loader = new ZendExtension();
     $loader->i18nLoad(array(), $container);
     $this->assertEquals('Zend\\Translator\\Translator', $container->getParameter('zend.translator.class'), '->i&8nLoad() loads the i18n.xml file if not already loaded');
     $loader->i18nLoad(array('adapter' => 'Zend\\Translator\\Translator::AN_XLIFF', 'locale' => 'fr'), $container);
     $this->assertEquals('Xliff', $container->getParameter('zend.translator.adapter'), '->i18nLoad() overrides existing configuration options');
     $this->assertEquals('fr', $container->getParameter('zend.translator.locale'), '->i18nLoad() overrides existing configuration options');
 }
Example #3
0
 public function testConfigLoad()
 {
     // logger
     $container = new ContainerBuilder();
     $loader = new ZendExtension();
     $loader->configLoad(array('logger' => array()), $container);
     $this->assertEquals('Symfony\\Bundle\\ZendBundle\\Logger\\Logger', $container->getParameter('zend.logger.class'), '->loggerLoad() loads the logger.xml file if not already loaded');
     $loader->configLoad(array('logger' => array('priority' => 3)), $container);
     $this->assertEquals(3, $container->getParameter('zend.logger.priority'), '->loggerLoad() overrides existing configuration options');
     // i18n
     $loader->configLoad(array('i18n' => array()), $container);
     $this->assertEquals('Zend\\Translator\\Translator', $container->getParameter('zend.translator.class'), '->i&8nLoad() loads the i18n.xml file if not already loaded');
     $loader->configLoad(array('i18n' => array('adapter' => 'Zend\\Translator\\Translator::AN_XLIFF', 'locale' => 'fr')), $container);
     $this->assertEquals('Xliff', $container->getParameter('zend.translator.adapter'), '->i18nLoad() overrides existing configuration options');
     $this->assertEquals('fr', $container->getParameter('zend.translator.locale'), '->i18nLoad() overrides existing configuration options');
 }