mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Reinstated UploadTest (from r99862)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@105540 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
b632c8ff88
commit
f86c05ba08
@ -163,7 +163,7 @@ class Upload extends Controller {
|
|||||||
// we don't validate for empty upload fields yet
|
// we don't validate for empty upload fields yet
|
||||||
if(!isset($tmpFile['name']) || empty($tmpFile['name'])) return true;
|
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');
|
$this->errors[] = _t('File.NOVALIDUPLOAD', 'File is not a valid upload');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -7,9 +7,6 @@ class UploadTest extends SapphireTest {
|
|||||||
static $fixture_file = 'sapphire/tests/filesystem/UploadTest.yml';
|
static $fixture_file = 'sapphire/tests/filesystem/UploadTest.yml';
|
||||||
|
|
||||||
function testUpload() {
|
function testUpload() {
|
||||||
// For some reason, this isn't working in cli-script.php
|
|
||||||
/*
|
|
||||||
|
|
||||||
// create tmp file
|
// create tmp file
|
||||||
$tmpFileName = 'UploadTest_testUpload.txt';
|
$tmpFileName = 'UploadTest_testUpload.txt';
|
||||||
$tmpFilePath = TEMP_FOLDER . '/' . $tmpFileName;
|
$tmpFilePath = TEMP_FOLDER . '/' . $tmpFileName;
|
||||||
@ -57,7 +54,6 @@ class UploadTest extends SapphireTest {
|
|||||||
$file2->delete();
|
$file2->delete();
|
||||||
|
|
||||||
unlink($tmpFilePath);
|
unlink($tmpFilePath);
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function testAllowedFilesize() {
|
function testAllowedFilesize() {
|
||||||
|
Loading…
Reference in New Issue
Block a user