aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/upload/filespec_test.php (renamed from tests/uploads/filespec_test.php)30
-rw-r--r--tests/upload/fileupload_test.php (renamed from tests/uploads/fileupload_test.php)0
-rw-r--r--tests/upload/fixture/gif (renamed from tests/uploads/fixture/gif)bin35 -> 35 bytes
-rw-r--r--tests/upload/fixture/jpg (renamed from tests/uploads/fixture/jpg)bin519 -> 519 bytes
-rw-r--r--tests/upload/fixture/png (renamed from tests/uploads/fixture/png)bin69 -> 69 bytes
-rw-r--r--tests/upload/fixture/tif (renamed from tests/uploads/fixture/tif)bin256 -> 256 bytes
-rw-r--r--tests/upload/fixture/txt (renamed from tests/uploads/fixture/txt)0
-rw-r--r--tests/uploads/common.php0
8 files changed, 8 insertions, 22 deletions
diff --git a/tests/uploads/filespec_test.php b/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
index 2b3c17b8e0..2b3c17b8e0 100644
--- a/tests/uploads/fileupload_test.php
+++ b/tests/upload/fileupload_test.php
diff --git a/tests/uploads/fixture/gif b/tests/upload/fixture/gif
index b636f4b8df..b636f4b8df 100644
--- a/tests/uploads/fixture/gif
+++ b/tests/upload/fixture/gif
Binary files differ
diff --git a/tests/uploads/fixture/jpg b/tests/upload/fixture/jpg
index 3cd5038e38..3cd5038e38 100644
--- a/tests/uploads/fixture/jpg
+++ b/tests/upload/fixture/jpg
Binary files differ
diff --git a/tests/uploads/fixture/png b/tests/upload/fixture/png
index 5514ad40e9..5514ad40e9 100644
--- a/tests/uploads/fixture/png
+++ b/tests/upload/fixture/png
Binary files differ
diff --git a/tests/uploads/fixture/tif b/tests/upload/fixture/tif
index 248b50f9cb..248b50f9cb 100644
--- a/tests/uploads/fixture/tif
+++ b/tests/upload/fixture/tif
Binary files differ
diff --git a/tests/uploads/fixture/txt b/tests/upload/fixture/txt
index d3c40d2ea7..d3c40d2ea7 100644
--- a/tests/uploads/fixture/txt
+++ b/tests/upload/fixture/txt
diff --git a/tests/uploads/common.php b/tests/uploads/common.php
deleted file mode 100644
index e69de29bb2..0000000000
--- a/tests/uploads/common.php
+++ /dev/null