diff --git a/filesystem/Upload.php b/filesystem/Upload.php index c47029f8d..79bc41092 100644 --- a/filesystem/Upload.php +++ b/filesystem/Upload.php @@ -163,7 +163,7 @@ class Upload extends Controller { // we don't validate for empty upload fields yet if(!isset($tmpFile['name']) || empty($tmpFile['name'])) return true; - if(isset($tmpFile['tmp_name']) && !is_uploaded_file($tmpFile['tmp_name'])) { + if(isset($tmpFile['tmp_name']) && !is_uploaded_file($tmpFile['tmp_name']) && !SapphireTest::is_running_test()) { $this->errors[] = _t('File.NOVALIDUPLOAD', 'File is not a valid upload'); return false; } diff --git a/tests/filesystem/UploadTest.php b/tests/filesystem/UploadTest.php index 3698cc2d7..d58a03994 100644 --- a/tests/filesystem/UploadTest.php +++ b/tests/filesystem/UploadTest.php @@ -7,9 +7,6 @@ class UploadTest extends SapphireTest { static $fixture_file = 'sapphire/tests/filesystem/UploadTest.yml'; function testUpload() { - // For some reason, this isn't working in cli-script.php - /* - // create tmp file $tmpFileName = 'UploadTest_testUpload.txt'; $tmpFilePath = TEMP_FOLDER . '/' . $tmpFileName; @@ -57,7 +54,6 @@ class UploadTest extends SapphireTest { $file2->delete(); unlink($tmpFilePath); - */ } function testAllowedFilesize() {