Exemple #1
0
 /**
  * Remove TMP/tests directory to its original state.
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
     $cleaner = function ($dir) use(&$cleaner) {
         $files = array_diff(scandir($dir), ['.', '..']);
         foreach ($files as $file) {
             $path = $dir . DIRECTORY_SEPARATOR . $file;
             if (is_dir($path)) {
                 $cleaner($path);
             } else {
                 unlink($path);
             }
         }
         rmdir($dir);
     };
     if (file_exists(sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'tests')) {
         $cleaner(sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'tests');
     }
     parent::tearDown();
 }
Exemple #2
0
 /**
  * tearDown method
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
 }
Exemple #3
0
 /**
  * tearDown method
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
     $this->file->close();
     unset($this->file);
 }