Ejemplo n.º 1
0
 /**
  * Test the service methods for the container inside a command.
  */
 public function testServices()
 {
     $this->assertNull($this->command->get('console'));
     $container = new ContainerBuilder();
     $console = $container->register('console', '\\Symfony\\Component\\Console\\Application');
     $console->addArgument('slic');
     $this->command->setContainer($container);
     $this->assertInstanceOf('\\Symfony\\Component\\Console\\Application', $this->command->get('console'));
 }
Ejemplo n.º 2
0
 /**
  * Register a command that we'll be able to use.
  *
  * @param Sic\Command\Command $command
  * @return Slic\Application
  */
 public function registerCommand(SlicCommand $command)
 {
     $command->setContainer($this->getContainer());
     $this->container->get('console')->add($command);
     return $this;
 }