init() public method

public init ( array $initConfig = [], Symfony\Component\Console\Input\InputInterface $input = null, Symfony\Component\Console\Output\OutputInterface $output = null ) : void
$initConfig array [optional]
$input Symfony\Component\Console\Input\InputInterface [optional]
$output Symfony\Component\Console\Output\OutputInterface [optional]
return void
Ejemplo n.º 1
0
 /**
  * Get an instance of the Magerun app.
  *
  * @return \N98\Magento\Application
  */
 public function getMagerun()
 {
     if (!$this->magerun) {
         $this->magerun = new MagerunApplication($this->getApplication()->getAutoloader());
         $this->magerun->init();
     }
     return $this->magerun;
 }
Ejemplo n.º 2
0
 /**
  * @return PHPUnit_Framework_MockObject_MockObject|Application
  */
 public function getApplication()
 {
     if ($this->application === null) {
         $root = $this->getTestMagentoRoot();
         $this->application = $this->getMock('N98\\Magento\\Application', array('getMagentoRootFolder'));
         $loader = (require __DIR__ . '/../../../../../vendor/autoload.php');
         $this->application->setAutoloader($loader);
         $this->application->expects($this->any())->method('getMagentoRootFolder')->will($this->returnValue($root));
         $this->application->init();
         $this->application->initMagento();
         if ($this->application->getMagentoMajorVersion() == Application::MAGENTO_MAJOR_VERSION_1) {
             spl_autoload_unregister(array(\Varien_Autoload::instance(), 'autoload'));
         }
     }
     return $this->application;
 }
Ejemplo n.º 3
0
 /**
  * @throws \RuntimeException
  * @return PHPUnit_Framework_MockObject_MockObject|\N98\Magento\Application
  */
 public function getApplication()
 {
     if ($this->application === null) {
         $root = getenv('N98_MAGERUN_TEST_MAGENTO_ROOT');
         if (empty($root)) {
             throw new \RuntimeException('Please specify environment variable N98_MAGERUN_TEST_MAGENTO_ROOT with path to your test
                 magento installation!');
         }
         $this->application = $this->getMock('N98\\Magento\\Application', array('getMagentoRootFolder'));
         $loader = (require __DIR__ . '/../../../../../vendor/autoload.php');
         $this->application->setAutoloader($loader);
         $this->application->expects($this->any())->method('getMagentoRootFolder')->will($this->returnValue($root));
         $this->application->init();
         $this->application->initMagento();
         if ($this->application->getMagentoMajorVersion() == Application::MAGENTO_MAJOR_VERSION_1) {
             spl_autoload_unregister(array(\Varien_Autoload::instance(), 'autoload'));
         }
     }
     return $this->application;
 }