Exemple #1
0
 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
     Autoloader::resetInstance();
 }
 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 public function setUp()
 {
     if (file_exists($this->_includeCache)) {
         unlink($this->_includeCache);
     }
     // Possible for previous tests to remove autoloader
     Autoloader::resetInstance();
     $al = Autoloader::getInstance();
     $al->registerPrefix('PHPUnit_');
     PluginLoader::setIncludeFileCache(null);
     $this->_includeCache = __DIR__ . '/_files/includeCache.inc.php';
     $this->libPath = realpath(__DIR__ . '/../../../library');
     $this->key = null;
 }
Exemple #3
0
 public function tearDown()
 {
     \Zend\Db\Table\AbstractTable::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
     Autoloader::resetInstance();
 }
 public function tearDown()
 {
     if (!$this->isEnabled()) {
         return;
     }
     // Restore original autoloaders
     $loaders = spl_autoload_functions();
     foreach ($loaders as $loader) {
         spl_autoload_unregister($loader);
     }
     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
     Autoloader::resetInstance();
     Autoloader::getInstance();
 }
Exemple #5
0
 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
     Autoloader::resetInstance();
 }
Exemple #6
0
 public function testSingletonInstanceShouldAllowReset()
 {
     ZendAutoloader::resetInstance();
     $autoloader = ZendAutoloader::getInstance();
     $this->assertNotSame($this->autoloader, $autoloader);
 }