MINOR Reinstated UploadTest

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@99862 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2010-02-25 01:07:21 +00:00 committed by Sam Minnee
parent fea7ba3bcf
commit fd1ca45c07
2 changed files with 1 additions and 5 deletions

View File

@ -165,7 +165,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;
}

View File

@ -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() {