Skip to content

Commit

Permalink
FIX: Remove unnecessary UploadTest\Validator
Browse files Browse the repository at this point in the history
Its use-case had been previously replaced by the use_is_uploaded_file
config option
  • Loading branch information
Sam Minnee committed Oct 3, 2018
1 parent e7c45d9 commit fbd8843
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 58 deletions.
28 changes: 14 additions & 14 deletions tests/php/UploadTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function testUpload()
'error' => UPLOAD_ERR_OK,
);

$v = new UploadTest\Validator();
$v = new Upload_Validator();

// test upload into default folder
$u1 = new Upload();
Expand Down Expand Up @@ -134,7 +134,7 @@ public function testAllowedFilesize()

// test upload into default folder
$u1 = new Upload();
$v = new UploadTest\Validator();
$v = new Upload_Validator();

$v->setAllowedMaxFileSize(array('txt' => 10));
$u1->setValidator($v);
Expand Down Expand Up @@ -261,7 +261,7 @@ public function testGetAllowedMaxFileSize()
'txt' => 1000
);
Upload_Validator::config()->set('default_max_file_size', $configMaxFileSizes);
$v = new UploadTest\Validator();
$v = new Upload_Validator();

$retrievedSize = $v->getAllowedMaxFileSize('[image]');
$this->assertEquals(
Expand All @@ -282,7 +282,7 @@ public function testGetAllowedMaxFileSize()
'[document]' => 2000,
'txt' => '4k'
);
$v = new UploadTest\Validator();
$v = new Upload_Validator();
$v->setAllowedMaxFileSize($maxFileSizes);

$retrievedSize = $v->getAllowedMaxFileSize('[document]');
Expand Down Expand Up @@ -313,7 +313,7 @@ public function testGetAllowedMaxFileSize()
);

// Check a wildcard max file size against a file with an extension
$v = new UploadTest\Validator();
$v = new Upload_Validator();
$v->setAllowedMaxFileSize(2000);

$retrievedSize = $v->getAllowedMaxFileSize('.jpg');
Expand Down Expand Up @@ -344,7 +344,7 @@ public function testAllowedSizeOnFileWithNoExtension()
'error' => UPLOAD_ERR_OK,
);

$v = new UploadTest\Validator();
$v = new Upload_Validator();
$v->setAllowedMaxFileSize(array('' => 10));

// test upload into default folder
Expand Down Expand Up @@ -373,7 +373,7 @@ public function testUploadDoesNotAllowUnknownExtension()
'error' => UPLOAD_ERR_OK,
);

$v = new UploadTest\Validator();
$v = new Upload_Validator();
$v->setAllowedExtensions(array('txt'));

// test upload into default folder
Expand Down Expand Up @@ -402,7 +402,7 @@ public function testUploadAcceptsAllowedExtension()
'error' => UPLOAD_ERR_OK,
);

$v = new UploadTest\Validator();
$v = new Upload_Validator();
$v->setAllowedExtensions(array('txt'));

// test upload into default folder
Expand Down Expand Up @@ -434,7 +434,7 @@ public function testUploadDeniesNoExtensionFilesIfNoEmptyStringSetForValidatorEx
'error' => UPLOAD_ERR_OK,
);

$v = new UploadTest\Validator();
$v = new Upload_Validator();
$v->setAllowedExtensions(array('txt'));

// test upload into default folder
Expand Down Expand Up @@ -533,7 +533,7 @@ public function testUploadFileWithNoExtensionTwiceAppendsNumber()
'error' => UPLOAD_ERR_OK,
);

$v = new UploadTest\Validator();
$v = new Upload_Validator();
$v->setAllowedExtensions(array(''));

// test upload into default folder
Expand Down Expand Up @@ -591,7 +591,7 @@ public function testReplaceFile()
'error' => UPLOAD_ERR_OK,
);

$v = new UploadTest\Validator();
$v = new Upload_Validator();
$v->setAllowedExtensions(array(''));

// test upload into default folder
Expand Down Expand Up @@ -650,7 +650,7 @@ public function testReplaceFileWithLoadIntoFile()
'error' => UPLOAD_ERR_OK,
);

$v = new UploadTest\Validator();
$v = new Upload_Validator();

// test upload into default folder
$u = new Upload();
Expand Down Expand Up @@ -731,7 +731,7 @@ public function testDeleteResampledImagesOnUpload()
'error' => UPLOAD_ERR_OK,
);

$v = new UploadTest\Validator();
$v = new Upload_Validator();

// test upload into default folder
$u = new Upload();
Expand Down Expand Up @@ -772,7 +772,7 @@ public function testFileVersioningWithAnExistingFile()
'error' => UPLOAD_ERR_OK,
);

$v = new UploadTest\Validator();
$v = new Upload_Validator();

// test upload into default folder
$u = new Upload();
Expand Down
44 changes: 0 additions & 44 deletions tests/php/UploadTest/Validator.php

This file was deleted.

0 comments on commit fbd8843

Please sign in to comment.