/**
  * Returns image utils instance
  *
  * @return oxUtilsPic
  */
 public static function getInstance()
 {
     // disable caching for test modules
     if (defined('OXID_PHP_UNIT')) {
         self::$_instance = modInstances::getMod(__CLASS__);
     }
     if (!self::$_instance instanceof oxUtilsPic) {
         self::$_instance = oxNew('oxUtilsPic');
         if (defined('OXID_PHP_UNIT')) {
             modInstances::addMod(__CLASS__, self::$_instance);
         }
     }
     return self::$_instance;
 }
 /**
  * Returns oxPaymentList instance
  *
  * @return oxpaymentList
  */
 public static function getInstance()
 {
     // disable cashing for test modules
     if (defined('OXID_PHP_UNIT')) {
         self::$_instance = modInstances::getMod(__CLASS__);
     }
     if (!isset(self::$_instance)) {
         // allow modules
         self::$_instance = oxNew('oxPaymentList');
         if (defined('OXID_PHP_UNIT')) {
             modInstances::addMod(__CLASS__, self::$_instance);
         }
     }
     return self::$_instance;
 }
Esempio n. 3
0
 /**
  * Returns Singelton instance
  *
  * @return oxdb
  */
 public static function getInstance()
 {
     // disable caching for test modules
     if (defined('OXID_PHP_UNIT')) {
         self::$_instance = modInstances::getMod(__CLASS__);
     }
     if (!self::$_instance instanceof oxDb) {
         //do not use simple oxNew here as it goes to eternal cycle
         self::$_instance = oxNew('oxdb');
         if (defined('OXID_PHP_UNIT')) {
             modInstances::addMod(__CLASS__, self::$_instance);
         }
     }
     return self::$_instance;
 }
 /**
  * Returns object instance
  *
  * @return oxutilsobject
  */
 public static function getInstance()
 {
     // disable caching for test modules
     if (defined('OXID_PHP_UNIT')) {
         self::$_instance = modInstances::getMod(__CLASS__);
     }
     if (!self::$_instance instanceof oxUtilsObject) {
         // allow modules
         $oUtilsObject = new oxUtilsObject();
         self::$_instance = $oUtilsObject->oxNew('oxUtilsObject');
         if (defined('OXID_PHP_UNIT')) {
             modInstances::addMod(__CLASS__, self::$_instance);
         }
     }
     return self::$_instance;
 }
 /**
  * Returns oxInputValidator instance
  *
  * @return oxInputValidator
  */
 static function getInstance()
 {
     if (defined('OXID_PHP_UNIT')) {
         if (($oClassMod = modInstances::getMod(__CLASS__)) && is_object($oClassMod)) {
             return $oClassMod;
         } else {
             $inst = oxNew('oxInputValidator');
             modInstances::addMod(__CLASS__, $inst);
             return $inst;
         }
     }
     if (!isset(self::$_instance)) {
         // allow modules
         self::$_instance = oxNew('oxInputValidator');
     }
     return self::$_instance;
 }
 /**
  * Singleton method
  *
  * @return oxSeoEncoderContent
  */
 public static function getInstance()
 {
     if (defined('OXID_PHP_UNIT')) {
         self::$_instance = modInstances::getMod(__CLASS__);
     }
     if (!self::$_instance) {
         self::$_instance = oxNew("oxSeoEncoderContent");
         if (defined('OXID_PHP_UNIT')) {
             modInstances::addMod(__CLASS__, self::$_instance);
         }
     }
     if (defined('OXID_PHP_UNIT')) {
         // resetting cache
         self::$_instance->_aSeoCache = array();
     }
     return self::$_instance;
 }
 /**
  * Singleton method
  *
  * @return oxSeoEncoderRecomm
  */
 public static function getInstance()
 {
     // disable caching for test modules
     if (defined('OXID_PHP_UNIT')) {
         self::$_instance = modInstances::getMod(__CLASS__);
     }
     if (!self::$_instance instanceof oxSeoEncoderRecomm) {
         self::$_instance = oxNew('oxSeoEncoderRecomm');
         if (defined('OXID_PHP_UNIT')) {
             modInstances::addMod(__CLASS__, self::$_instance);
         }
     }
     if (defined('OXID_PHP_UNIT')) {
         // resetting cache
         self::$_instance->_aSeoCache = array();
     }
     return self::$_instance;
 }
 /**
  * Singleton method
  *
  * @return oxseoencoder
  */
 public static function getInstance()
 {
     if (defined('OXID_PHP_UNIT')) {
         self::$_instance = modInstances::getMod(__CLASS__);
     }
     if (!self::$_instance) {
         self::$_instance = oxNew("oxSeoEncoder");
         if (defined('OXID_PHP_UNIT')) {
             modInstances::addMod(__CLASS__, self::$_instance);
         }
     }
     return self::$_instance;
 }
 /**
  * Executed after test is down
  *
  */
 protected function tearDown()
 {
     //TS2012-06-06
     //deprecated method call
     //overrideGetShopBasePath(null);
     oxTestsStaticCleaner::clean('oxSeoEncoder', '_instance');
     oxTestsStaticCleaner::clean('oxSeoEncoderArticle', '_instance');
     oxTestsStaticCleaner::clean('oxSeoEncoderCategory', '_instance');
     oxTestsStaticCleaner::clean('oxVatSelector', '_instance');
     oxTestsStaticCleaner::clean('oxDiscountList', '_instance');
     oxTestsStaticCleaner::clean('oxUtilsObject', '_aInstanceCache');
     oxTestsStaticCleaner::clean('oxArticle', '_aLoadedParents');
     modInstances::cleanup();
     oxTestModules::cleanUp();
     modOxid::globalCleanup();
     modDB::getInstance()->cleanup();
     $this->getSession()->cleanup();
     $this->getConfig()->cleanup();
     $_SERVER = $this->_aBackup['_SERVER'];
     $_POST = $this->_aBackup['_POST'];
     $_GET = $this->_aBackup['_GET'];
     $_SESSION = $this->_aBackup['_SESSION'];
     $_COOKIE = $this->_aBackup['_COOKIE'];
     $this->_resetRegistry();
     oxUtilsObject::resetClassInstances();
     oxUtilsObject::resetModuleVars();
     parent::tearDown();
 }
Esempio n. 10
0
 public static function cleanup()
 {
     self::$_aInst = array();
 }
Esempio n. 11
0
 /**
  * Executed after test is down
  *
  */
 protected function tearDown()
 {
     oxTestsStaticCleaner::clean('oxSeoEncoder', '_instance');
     oxTestsStaticCleaner::clean('oxSeoEncoderArticle', '_instance');
     oxTestsStaticCleaner::clean('oxSeoEncoderCategory', '_instance');
     oxTestsStaticCleaner::clean('oxVatSelector', '_instance');
     oxTestsStaticCleaner::clean('oxDiscountList', '_instance');
     oxTestsStaticCleaner::clean('oxUtilsObject', '_aInstanceCache');
     oxTestsStaticCleaner::clean('oxArticle', '_aLoadedParents');
     modInstances::cleanup();
     oxTestModules::cleanUp();
     modOxid::globalCleanup();
     modSession::getInstance()->cleanup();
     modDb::getInstance()->cleanup();
     modConfig::getInstance()->cleanup();
     $_SERVER = $this->_aBackup['_SERVER'];
     $_POST = $this->_aBackup['_POST'];
     $_GET = $this->_aBackup['_GET'];
     $_SESSION = $this->_aBackup['_SESSION'];
     $_COOKIE = $this->_aBackup['_COOKIE'];
     parent::tearDown();
     //oxTestRegister::execute();
 }
Esempio n. 12
0
 /**
  * Executed after test is down
  *
  */
 protected function tearDown()
 {
     $this->cleanUpDatabase();
     modDb::getInstance()->modAttach(modDb::getInstance()->getRealInstance());
     oxTestsStaticCleaner::clean('oxUtilsObject', '_aInstanceCache');
     oxTestsStaticCleaner::clean('oxArticle', '_aLoadedParents');
     modInstances::cleanup();
     oxTestModules::cleanUp();
     modOxid::globalCleanup();
     modDB::getInstance()->cleanup();
     $this->getSession()->cleanup();
     $this->getConfig()->cleanup();
     $_SERVER = $this->_aBackup['_SERVER'];
     $_POST = $this->_aBackup['_POST'];
     $_GET = $this->_aBackup['_GET'];
     $_SESSION = $this->_aBackup['_SESSION'];
     $_COOKIE = $this->_aBackup['_COOKIE'];
     $this->_resetRegistry();
     oxUtilsObject::resetClassInstances();
     oxUtilsObject::resetModuleVars();
     parent::tearDown();
 }
Esempio n. 13
0
 /**
  * resturns a single instance of this class
  *
  * @return oxLang
  */
 public static function getInstance()
 {
     if (defined('OXID_PHP_UNIT')) {
         if (($oClassMod = modInstances::getMod(__CLASS__)) && is_object($oClassMod)) {
             return $oClassMod;
         } else {
             $inst = oxNew('oxLang');
             modInstances::addMod(__CLASS__, $inst);
             return $inst;
         }
     }
     if (!self::$_instance instanceof oxLang) {
         self::$_instance = oxNew('oxLang');
     }
     return self::$_instance;
 }