public function tearDown() { Zend_Loader_AutoloaderFactory::unregisterAutoloaders(); // Restore original autoloaders $loaders = spl_autoload_functions(); if (is_array($loaders)) { foreach ($loaders as $loader) { spl_autoload_unregister($loader); } } foreach ($this->_loaders as $loader) { spl_autoload_register($loader); } // Restore original include_path set_include_path($this->_includePath); }
public function testCanUnregisterAutoloaders() { Zend_Loader_AutoloaderFactory::factory(array('Zend_Loader_StandardAutoloader' => array('prefixes' => array('TestPrefix' => dirname(__FILE__) . '/TestAsset/TestPrefix')))); Zend_Loader_AutoloaderFactory::unregisterAutoloaders(); $this->assertEquals(0, count(Zend_Loader_AutoloaderFactory::getRegisteredAutoloaders())); }