public function testInjectKernelContainerToCommand() { $container = \Mockery::mock('Symfony\\Component\\DependencyInjection\\ContainerInterface'); $this->kernel->shouldReceive('getContainer')->andReturn($container); $command = new ContainerAwareCommand(); $application = new Application($this->kernel); $application->add($command); static::assertSame($container, $command->getContainer()); }
/** * Constructor. * * @param string $environment * @param bool $debug */ public function __construct($environment = 'test', $debug = false) { parent::__construct($environment, $debug); }
public function testContainerIsAvailableAfterBoot() { $this->kernel->boot(); static::assertInstanceOf('Symfony\\Component\\DependencyInjection\\ContainerInterface', $this->kernel->getContainer()); }