Example #1
0
 /**
  * @magentoAppIsolation enabled
  */
 public function testReset()
 {
     Mage::setRoot(dirname(__FILE__));
     $this->assertNotNull(Mage::getRoot());
     Mage::reset();
     $this->assertNull(Mage::getRoot());
 }
 /**
  * Initialize and retrieve application
  *
  * @param   string $code
  * @param   string $type
  * @param   string|array $options
  * @return  Mage_Core_Model_App
  */
 public static function app($code = '', $type = 'store', $options = array())
 {
     if (null === self::$_app) {
         Varien_Profiler::start('mage::app::construct');
         self::$_app = new Mage_Core_Model_App();
         Varien_Profiler::stop('mage::app::construct');
         Mage::setRoot();
         Mage::register('events', new Varien_Event_Collection());
         Varien_Profiler::start('mage::app::register_config');
         Mage::register('config', new Mage_Core_Model_Config());
         Varien_Profiler::stop('mage::app::register_config');
         Varien_Profiler::start('mage::app::init');
         self::$_app->init($code, $type, $options);
         Varien_Profiler::stop('mage::app::init');
         self::$_app->loadAreaPart(Mage_Core_Model_App_Area::AREA_GLOBAL, Mage_Core_Model_App_Area::PART_EVENTS);
     }
     return self::$_app;
 }
Example #3
0
 * @copyright  Copyright (c) 2012 X.commerce, Inc. (http://www.magentocommerce.com)
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
/**
 * Constants definition
 */
define('DS', DIRECTORY_SEPARATOR);
define('BP', realpath(__DIR__ . '/../../..'));
/**
 * Require necessary files
 */
require_once BP . '/app/code/core/Mage/Core/functions.php';
require_once BP . '/app/Mage.php';
require __DIR__ . '/../../../app/autoload.php';
Magento_Autoload_IncludePath::addIncludePath(array(BP . DS . 'app' . DS . 'code' . DS . 'local', BP . DS . 'app' . DS . 'code' . DS . 'community', BP . DS . 'app' . DS . 'code' . DS . 'core', BP . DS . 'lib'));
Mage::setRoot();
$definitions = array();
class ArrayDefinitionCompiler
{
    /**#@+
     * Abstract classes
     */
    const ABSTRACT_MODEL = 'Mage_Core_Model_Abstract';
    const ABSTRACT_BLOCK = 'Mage_Core_Block_Abstract';
    /**#@-*/
    /**
     * Main config
     *
     * @var Mage_Core_Model_Config
     */
    protected $_config;
 public static function iniMage()
 {
     chdir(self::getProjectDir());
     require self::getProjectDir() . '/app/Mage.php';
     Mage::setRoot(self::getProjectDir() . '/app');
     Mage::app('admin')->setUseSessionInUrl(false);
     Mage::setIsDeveloperMode(true);
     umask(0);
 }
Example #5
0
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    tests
 * @package     selenium2
 * @subpackage  runner
 * @author      Magento Core Team <*****@*****.**>
 * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
if (!defined('INTEGRATION_TEST_FLAG')) {
    if (version_compare(PHPUnit_Runner_Version::id(), '3.6.0', '<')) {
        throw new RuntimeException('PHPUnit 3.6.0 (or later) is required.');
    }
}
$rootDir = dirname(dirname(dirname(__FILE__)));
define('TBP', $rootDir . DIRECTORY_SEPARATOR . 'tests');
require_once $rootDir . DIRECTORY_SEPARATOR . 'tests/framework/Mage.php';
if (!defined('INTEGRATION_TEST_FLAG')) {
    require_once $rootDir . DIRECTORY_SEPARATOR . 'tests/framework/Xcom_TestCase_Abstract.php';
    require_once $rootDir . DIRECTORY_SEPARATOR . 'tests/framework/Xcom_TestCase.php';
    require_once $rootDir . DIRECTORY_SEPARATOR . 'tests/framework/Xcom_Database_TestCase.php';
    require_once $rootDir . DIRECTORY_SEPARATOR . 'tests/framework/Xcom_Collection_TestCase.php';
    require_once $rootDir . DIRECTORY_SEPARATOR . 'tests/framework/Xcom_Integration_TestCase.php';
    require_once $rootDir . DIRECTORY_SEPARATOR . 'tests/framework/Xcom_Fabric_TestCase.php';
    require_once $rootDir . DIRECTORY_SEPARATOR . 'tests/framework/Xcom_Messaging_TestCase.php';
}
Mage::setRoot($rootDir . DIRECTORY_SEPARATOR . 'app');
if (!defined('INTEGRATION_TEST_FLAG')) {
    Mage::app();
}
Example #6
0
 /**
  * Initialize and retrieve application
  *
  * @param   string $code
  * @param   string $type
  * @param   string $etcDir
  * @return  Mage_Core_Model_App
  */
 public static function app($code = '', $type = 'store', $etcDir = null)
 {
     if (is_null(self::$_app)) {
         Varien_Profiler::start('app/init');
         self::$_app = new Mage_Core_Model_App();
         Mage::setRoot();
         Mage::register('events', new Varien_Event_Collection());
         Mage::register('config', new Mage_Core_Model_Config());
         self::$_app->init($code, $type, $etcDir);
         self::$_app->loadAreaPart(Mage_Core_Model_App_Area::AREA_GLOBAL, Mage_Core_Model_App_Area::PART_EVENTS);
     }
     return self::$_app;
 }