/** * 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(); }
/** * tearDown method * * @return void */ public function tearDown() { parent::tearDown(); }
/** * tearDown method * * @return void */ public function tearDown() { parent::tearDown(); $this->file->close(); unset($this->file); }