diff options
author | Fyorl <gaelreth@gmail.com> | 2012-07-02 22:36:12 +0100 |
---|---|---|
committer | Fyorl <gaelreth@gmail.com> | 2012-07-09 14:08:18 +0100 |
commit | f2bbbdaaface8ca63a3a70e98140c0e51c5e8b0b (patch) | |
tree | f66cc7452b9922fbceb48319111db1aa0409db44 | |
parent | 82ca2c8b08ca8c21b358ee8c862c639a5944977d (diff) | |
download | forums-f2bbbdaaface8ca63a3a70e98140c0e51c5e8b0b.tar forums-f2bbbdaaface8ca63a3a70e98140c0e51c5e8b0b.tar.gz forums-f2bbbdaaface8ca63a3a70e98140c0e51c5e8b0b.tar.bz2 forums-f2bbbdaaface8ca63a3a70e98140c0e51c5e8b0b.tar.xz forums-f2bbbdaaface8ca63a3a70e98140c0e51c5e8b0b.zip |
[ticket/10941] tearDown() now uses explicit file list
Instances of $it also renamed for clarity.
PHPBB3-10941
-rw-r--r-- | tests/uploads/filespec_test.php | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/tests/uploads/filespec_test.php b/tests/uploads/filespec_test.php index 3c9eda4468..80237d7622 100644 --- a/tests/uploads/filespec_test.php +++ b/tests/uploads/filespec_test.php @@ -43,8 +43,8 @@ class phpbb_filespec_test extends phpbb_test_case $this->init_filespec(); // Create copies of the files for use in testing move_file - $it = new DirectoryIterator($this->path); - foreach ($it as $fileinfo) + $iterator = new DirectoryIterator($this->path); + foreach ($iterator as $fileinfo) { if ($fileinfo->isDot()) { @@ -142,10 +142,24 @@ class phpbb_filespec_test extends phpbb_test_case protected function tearDown() { - $it = new DirectoryIterator($this->path); - foreach ($it as $fileinfo) + $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, + ); + + $iterator = new DirectoryIterator($this->path); + foreach ($iterator as $fileinfo) { - if (strlen($fileinfo->getFilename()) > 3) + if (isset($files[$fileinfo->getFilename()])) { unlink($fileinfo->getPathname()); } |