public function testLoad()
 {
     $ext = new ModeraConfigExtension();
     $builder = new ContainerBuilder();
     $ext->load(array(), $builder);
     $def = $builder->getDefinition('modera_config.twig.twig_extension');
     $this->assertEquals(TwigExtension::clazz(), $def->getClass());
     $this->assertEquals(1, count($def->getTag('twig.extension')));
     /* @var Reference $arg */
     $arg = $def->getArgument(0);
     $this->assertNotNull($arg);
     $this->assertEquals('modera_config.configuration_entries_manager', (string) $arg);
 }
Пример #2
0
 /**
  * @expectedException RuntimeException
  */
 public function testTwigModeraConfigValueStrict()
 {
     \Phake::when($this->configEntriesManager)->findOneByNameOrDie('foo', null)->thenThrow(new \RuntimeException('ololo'));
     $this->ext->twigModeraConfigValue('foo');
 }