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