public function setUp()
 {
     parent::setUp();
     $this->kernel = new AppKernel('test', true);
     $this->kernel->boot();
     $this->container = $this->kernel->getContainer();
 }
Пример #2
0
 /**
  * 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();
 }
Пример #3
0
 /**
  * @inheritdoc
  */
 public function get($name)
 {
     $command = parent::get($name);
     if ($command instanceof ContainerAwareInterface) {
         $command->setContainer($this->kernel->getContainer());
     }
     return $command;
 }
Пример #4
0
 public function __construct()
 {
     chdir(__DIR__);
     require __DIR__ . '/../vendor/autoload.php';
     $configPath = __DIR__ . '/../app/config/';
     $kernel = new Kernel($configPath);
     $kernel->loadContainer();
     $this->container = $kernel->getContainer();
 }