diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/uploads/filespec_test.php | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/tests/uploads/filespec_test.php b/tests/uploads/filespec_test.php index 0fc666f992..e91819142a 100644 --- a/tests/uploads/filespec_test.php +++ b/tests/uploads/filespec_test.php @@ -79,32 +79,27 @@ class phpbb_filespec_test extends phpbb_test_case protected function tearDown() { global $user; + $this->config = array(); + $user = null; $files = array( - 'gif_copy' => 1, - 'jpg_copy' => 1, - 'png_copy' => 1, - 'txt_copy' => 1, - 'txt_copy_2' => 1, - 'tif_copy' => 1, - 'gif_moved' => 1, - 'jpg_moved' => 1, - 'png_moved' => 1, - 'txt_as_img' => 1, - 'txt_moved' => 1, + 'gif_copy', + 'jpg_copy', + 'png_copy', + 'txt_copy', + 'txt_copy_2', + 'tif_copy', + 'gif_moved', + 'jpg_moved', + 'png_moved', + 'txt_as_img', + 'txt_moved', ); - $iterator = new DirectoryIterator($this->path); - foreach ($iterator as $fileinfo) + foreach ($files as $file) { - if (isset($files[$fileinfo->getFilename()])) - { - unlink($fileinfo->getPathname()); - } + @unlink($this->path . $file); } - - $this->config = array(); - $user = null; } public function additional_checks_variables() |