public function setUp() { parent::setUp(); $this->kernel = new AppKernel('test', true); $this->kernel->boot(); $this->container = $this->kernel->getContainer(); }
/** * Initializes context. * * @param Kernel $kernel */ public function __construct($kernel) { $this->kernel = $kernel; $this->container = $kernel->getContainer(); $this->doctrine = $kernel->getContainer()->get('doctrine'); $this->em = $this->doctrine->getManager(); }
/** * @inheritdoc */ public function get($name) { $command = parent::get($name); if ($command instanceof ContainerAwareInterface) { $command->setContainer($this->kernel->getContainer()); } return $command; }
public function __construct() { chdir(__DIR__); require __DIR__ . '/../vendor/autoload.php'; $configPath = __DIR__ . '/../app/config/'; $kernel = new Kernel($configPath); $kernel->loadContainer(); $this->container = $kernel->getContainer(); }