diff --git a/tests/uploads/filespec_test.php b/tests/upload/filespec_test.php similarity index 93% rename from tests/uploads/filespec_test.php rename to tests/upload/filespec_test.php index c3e3ddf8f2..7961e8ed64 100644 --- a/tests/uploads/filespec_test.php +++ b/tests/upload/filespec_test.php @@ -52,15 +52,15 @@ class phpbb_filespec_test extends phpbb_test_case $iterator = new DirectoryIterator($this->path); foreach ($iterator as $fileinfo) { - if ($fileinfo->isDot()) + if ($fileinfo->isDot() || $fileinfo->isDir()) { continue; } - copy($fileinfo->getPathname(), $this->path . $fileinfo->getFilename() . '_copy'); + copy($fileinfo->getPathname(), $this->path . 'copies/' . $fileinfo->getFilename() . '_copy'); if ($fileinfo->getFilename() === 'txt') { - copy($fileinfo->getPathname(), $this->path . $fileinfo->getFilename() . '_copy_2'); + copy($fileinfo->getPathname(), $this->path . 'copies/' . $fileinfo->getFilename() . '_copy_2'); } } } @@ -84,24 +84,10 @@ class phpbb_filespec_test extends phpbb_test_case global $user; $this->config = array(); $user = null; - - $files = array( - 'gif_copy', - 'jpg_copy', - 'png_copy', - 'txt_copy', - 'txt_copy_2', - 'tif_copy', - 'gif_moved', - 'jpg_moved', - 'png_moved', - 'txt_as_img', - 'txt_moved', - ); - foreach ($files as $file) + foreach (glob($this->path . 'copies/*') as $file) { - @unlink($this->path . $file); + unlink($file); } } @@ -266,7 +252,7 @@ class phpbb_filespec_test extends phpbb_test_case $upload->max_filesize = self::UPLOAD_MAX_FILESIZE; $filespec = $this->get_filespec(array( - 'tmp_name' => $this->path . $tmp_name, + 'tmp_name' => $this->path . 'copies/' . $tmp_name, 'name' => $realname, 'type' => $mime_type, )); @@ -274,8 +260,8 @@ class phpbb_filespec_test extends phpbb_test_case $filespec->upload = $upload; $filespec->local = true; - $this->assertEquals($expected, $filespec->move_file($this->path)); - $this->assertEquals($filespec->file_moved, file_exists($this->path . $realname)); + $this->assertEquals($expected, $filespec->move_file($this->path . 'copies')); + $this->assertEquals($filespec->file_moved, file_exists($this->path . 'copies/' . $realname)); if ($error) { $this->assertEquals($error, $filespec->error[0]); diff --git a/tests/uploads/fileupload_test.php b/tests/upload/fileupload_test.php similarity index 100% rename from tests/uploads/fileupload_test.php rename to tests/upload/fileupload_test.php diff --git a/tests/uploads/fixture/gif b/tests/upload/fixture/gif similarity index 100% rename from tests/uploads/fixture/gif rename to tests/upload/fixture/gif diff --git a/tests/uploads/fixture/jpg b/tests/upload/fixture/jpg similarity index 100% rename from tests/uploads/fixture/jpg rename to tests/upload/fixture/jpg diff --git a/tests/uploads/fixture/png b/tests/upload/fixture/png similarity index 100% rename from tests/uploads/fixture/png rename to tests/upload/fixture/png diff --git a/tests/uploads/fixture/tif b/tests/upload/fixture/tif similarity index 100% rename from tests/uploads/fixture/tif rename to tests/upload/fixture/tif diff --git a/tests/uploads/fixture/txt b/tests/upload/fixture/txt similarity index 100% rename from tests/uploads/fixture/txt rename to tests/upload/fixture/txt diff --git a/tests/uploads/common.php b/tests/uploads/common.php deleted file mode 100644 index e69de29bb2..0000000000