public function teardown() { $loaders = spl_autoload_functions(); foreach ($loaders as $loader) { spl_autoload_unregister($loader); } foreach ($this->loaders as $loader) { spl_autoload_register($loader); } Zend_Loader_Autoloader::resetInstance(); }
public function tearDown() { // Restore original autoloaders $loaders = spl_autoload_functions(); foreach ($loaders as $loader) { spl_autoload_unregister($loader); } foreach ($this->loaders as $loader) { spl_autoload_register($loader); } // Reset autoloader instance so it doesn't affect other tests Zend_Loader_Autoloader::resetInstance(); }
public function tearDown() { // Restore original autoloaders $loaders = spl_autoload_functions(); foreach ($loaders as $loader) { spl_autoload_unregister($loader); } foreach ($this->loaders as $loader) { spl_autoload_register($loader); } // Reset autoloader instance so it doesn't affect other tests Zend_Loader_Autoloader::resetInstance(); ZendX_JQuery_View_Helper_JQuery::disableNoConflictMode(); }
public function tearDown() { Zend_Db_Table::setDefaultAdapter(null); Zend_Db_Table::setDefaultMetadataCache(); // Restore original autoloaders $loaders = spl_autoload_functions(); foreach ($loaders as $loader) { spl_autoload_unregister($loader); } foreach ($this->loaders as $loader) { spl_autoload_register($loader); } // Reset autoloader instance so it doesn't affect other tests Zend_Loader_Autoloader::resetInstance(); }
public function tearDown() { if (method_exists('Doctrine_Manager', 'resetInstance')) { // as of 1.2ALPHA3 Doctrine_Manager::resetInstance(); } // Restore original autoloaders $loaders = spl_autoload_functions(); foreach ($loaders as $loader) { spl_autoload_unregister($loader); } foreach ($this->loaders as $loader) { spl_autoload_register($loader); } // Reset autoloader instance so it doesn't affect other tests Zend_Loader_Autoloader::resetInstance(); }
/** * Method to initialize Zend_Application for each test. */ public function setUpWithEnv($applicationEnv) { // Reducing memory footprint by forcing garbage collection runs // WARNING: Did not work on CI-System (PHP 5.3.14, PHPnit 3.5.13) // gc_collect_cycles(); $this->closeLogfile(); $this->closeDatabaseConnection(); // Resetting singletons or other kinds of persistent objects. Opus_Db_TableGateway::clearInstances(); // FIXME Does it help with the mystery bug? Zend_Registry::_unsetInstance(); // Reset autoloader to fix huge memory/cpu-time leak Zend_Loader_Autoloader::resetInstance(); $autoloader = Zend_Loader_Autoloader::getInstance(); $autoloader->suppressNotFoundWarnings(false); $autoloader->setFallbackAutoloader(true); // Clean-up possible artifacts in $_SERVER of previous test. unset($_SERVER['REMOTE_ADDR']); $this->bootstrap = new Zend_Application($applicationEnv, array("config" => array(APPLICATION_PATH . '/application/configs/application.ini', APPLICATION_PATH . '/tests/tests.ini', APPLICATION_PATH . '/tests/config.ini'))); // added to ensure that application log messages are written to opus.log when running unit tests // if not set messages are written to opus-console.log $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.0'; parent::setUp(); }
public function tearDown() { if ($this->errorHandler !== null) { restore_error_handler(); } // Restore original autoloaders $loaders = spl_autoload_functions(); if (is_array($loaders)) { foreach ($loaders as $loader) { spl_autoload_unregister($loader); } } if (is_array($this->loaders)) { foreach ($this->loaders as $loader) { spl_autoload_register($loader); } } // Retore original include_path set_include_path($this->includePath); // Reset autoloader instance so it doesn't affect other tests Zend_Loader_Autoloader::resetInstance(); }
public function testSingletonInstanceShouldAllowReset() { Zend_Loader_Autoloader::resetInstance(); $autoloader = Zend_Loader_Autoloader::getInstance(); $this->assertNotSame($this->autoloader, $autoloader); }
<?php set_include_path(implode(PATH_SEPARATOR, array( realpath(dirname(__FILE__) . '/../library'), get_include_path(), ))); defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application')); defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'testing'); defined('APPLICATION_LOAD_TESTDATA') || define('APPLICATION_LOAD_TESTDATA', true); require_once 'Zend/Loader/Autoloader.php'; $autoloader = Zend_Loader_Autoloader::getInstance(); spl_autoload_unregister(array($autoloader, 'autoload')); Zend_Loader_Autoloader::resetInstance(); $autoloader = Zend_Loader_Autoloader::getInstance(); $autoloader->registerNamespace('PHPUnit_');
public function tearDown() { Zend_Loader_Autoloader::resetInstance(); }
function _SF_Autloader_TearDown() { Zend_Loader_Autoloader::resetInstance(); $loader = Zend_Loader_Autoloader::getInstance(); $loader->registerNamespace('SF_'); }
public static function unregisterZend() { if (!self::$zendLoaded) { return true; } Zend_Loader_Autoloader::resetInstance(); spl_autoload_unregister(array('Zend_Loader_Autoloader', 'autoload')); self::$zendLoaded = false; }
public function tearDown() { Zend_Loader_Autoloader::resetInstance(); Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true); }