/**
  * Test related method
  */
 public function testLoad()
 {
     $this->extension->load($this->configs, $this->containerBuilder);
     $serviceIds = $this->containerBuilder->getServiceIds();
     $this->assertCount(3, $serviceIds);
     $this->assertTrue(in_array(self::PIM_TRANSLATION_FORM_TYPE, $serviceIds));
 }
Ejemplo n.º 2
0
 /**
  * Returns extension configuration.
  *
  * @param array                                                   $config    An array of configuration values
  * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container A ContainerBuilder instance
  *
  * @return \Symfony\Component\Config\Definition\ConfigurationInterface
  * @throws \RuntimeException
  */
 public function getConfiguration(array $config, ContainerBuilder $container)
 {
     $configuration = parent::getConfiguration($config, $container);
     if ($configuration instanceof ConfigurationInterface) {
         return $configuration;
     }
     throw new \RuntimeException('Expected configuration class not found!');
 }
 /**
  * @param Extension        $extension
  * @param ContainerBuilder $container
  *
  * @return void
  */
 private function loadExtension(Extension $extension, ContainerBuilder $container)
 {
     if (!$container->getExtensionConfig($extension->getAlias())) {
         $extension->load([], $container);
     }
 }
 public function getClassesToCompile()
 {
     return array_merge(parent::getClassesToCompile(), $this->extension->getClassesToCompile());
 }
 /**
  * Test related method
  */
 public function testLoad()
 {
     $this->extension->load($this->configs, $this->containerBuilder);
     $this->assertGreaterThanOrEqual(1, $this->containerBuilder->getServiceIds());
 }
Ejemplo n.º 6
0
 /**
  * Loads provided extension using a mocked container so that the definitions and parameters could be verified later.
  *
  * @param \Symfony\Component\HttpKernel\DependencyInjection\Extension $extension
  * @param array $config An optional array of configuration values
  * @return $this
  */
 protected function loadExtension(Extension $extension, $config = [])
 {
     $extension->load($config, $this->getContainerMock());
     return $this;
 }
Ejemplo n.º 7
0
 /**
  * @param Extension $extension
  * @return string
  */
 public static function configPath(Extension $extension)
 {
     return $extension->getAlias() . '.' . JsmodelProviderPass::JS_CONFIG_POSTFIX;
 }