diff options
author | Fyorl <gaelreth@gmail.com> | 2012-07-03 02:28:49 +0100 |
---|---|---|
committer | Fyorl <gaelreth@gmail.com> | 2012-07-09 14:08:19 +0100 |
commit | 682757c1cb1b7d7c8e438de374a790049a11164e (patch) | |
tree | 0a72db17a7ef335c0ec38e6d532617a2c2edc8a8 /tests | |
parent | ff7e5d73f767b756078f0966ea955a2d57a26988 (diff) | |
download | forums-682757c1cb1b7d7c8e438de374a790049a11164e.tar forums-682757c1cb1b7d7c8e438de374a790049a11164e.tar.gz forums-682757c1cb1b7d7c8e438de374a790049a11164e.tar.bz2 forums-682757c1cb1b7d7c8e438de374a790049a11164e.tar.xz forums-682757c1cb1b7d7c8e438de374a790049a11164e.zip |
[ticket/10941] Refactored tearDown to stop iterating over the directory.
PHPBB3-10941
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() |