Inheritance: extends PHPUnit_Framework_TestCase
Example #1
0
 /**
  * @throws \RuntimeException
  * @return \PHPUnit_Framework_MockObject_MockObject|\N98\Magento\Application
  */
 public function getApplication()
 {
     $application = parent::getApplication();
     if ($application::MAGENTO_MAJOR_VERSION_1 !== $application->getMagentoMajorVersion()) {
         return $application;
     }
     // FIXME #613 make install command work with 1.9+ and cache initialization
     $version = \Mage::getVersion();
     $against = '1.9.0.0';
     if ($application->isMagentoEnterprise()) {
         $against = '1.14.0.0';
     }
     if (-1 != version_compare($version, $against)) {
         $this->markTestSkipped(sprintf('Test skipped because it fails after new install of a Magento 1.9+ version (Magento version is: ' . '%s) which is the case on travis where we always have a new install.', $version));
     }
     return $application;
 }
 /**
  * Tears down the fixture, for example, close a network connection.
  * This method is called after a test is executed.
  */
 protected function tearDown()
 {
     foreach ($this->tearDownRestore as $restore) {
         $restore();
     }
     $restore = null;
     $this->tearDownRestore = null;
     parent::tearDown();
 }
Example #3
0
<?php

use N98\Magento\Command\TestCase;
$base = TestCase::getTestMagentoRootFromEnvironment('N98_MAGERUN_TEST_MAGENTO_ROOT', '.n98-magerun');
if (false === $base) {
    unset($base);
    return;
}
@session_start();
$loader = (require __DIR__ . '/../vendor/autoload.php');
/* @var $loader \Composer\Autoload\ClassLoader */
$loader->setUseIncludePath(true);
$paths = array($base . '/app/code/local', $base . '/app/code/community', $base . '/app/code/core', $base . '/lib');
set_include_path(implode(PATH_SEPARATOR, $paths) . PATH_SEPARATOR . get_include_path());
unset($paths, $base);