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 |
/** * 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; }
/** * @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; }
/** * @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; }