Example #1
0
 function it_should_load_available_tasks_from_the_service_container(ContainerBuilder $container, TaskCompilerPass $taskCompiler)
 {
     $container = ContainerFactory::buildFromConfiguration(__DIR__ . '/../../../resources/config/services.yml');
     $taskCompiler->process($container);
     $this->beConstructedWith($container);
     $this->getTasks()->shouldBeArray();
 }
Example #2
0
 /**
  * @return \Symfony\Component\DependencyInjection\ContainerBuilder
  */
 protected function getContainer()
 {
     if ($this->container) {
         return $this->container;
     }
     // Load cli options:
     $input = new ArgvInput();
     $input->bind($this->getDefaultInputDefinition());
     $configPath = $input->getOption('config');
     // Make sure to set the full path when it is declared relative
     // This will fix some issues in windows.
     $filesystem = new Filesystem();
     if (!$filesystem->isAbsolutePath($configPath)) {
         $configPath = getcwd() . DIRECTORY_SEPARATOR . $configPath;
     }
     // Build the service container:
     $this->container = ContainerFactory::buildFromConfiguration($configPath);
     return $this->container;
 }
Example #3
0
 /**
  * @return \Symfony\Component\DependencyInjection\ContainerBuilder
  */
 protected function getContainer()
 {
     if ($this->container) {
         return $this->container;
     }
     // Load cli options:
     $input = new ArgvInput();
     $configPath = $input->getParameterOption(['--config', '-c'], $this->getDefaultConfigPath());
     // Build the service container:
     $this->container = ContainerFactory::buildFromConfiguration($configPath);
     return $this->container;
 }