Add more test on UploadedFileSize validation

This commit is contained in:
vanquang9387 2015-10-20 09:00:32 +07:00
parent 13132cd113
commit 0cdfed0aee

View file

@ -2547,6 +2547,19 @@ class ValidationTest extends CakeTestCase {
'maxSize' => 100
);
$this->assertFalse(Validation::uploadedFile($file, $options), 'Too big');
$options = array(
'minSize' => 100,
);
$this->assertTrue(Validation::uploadedFile($file, $options));
$options = array(
'maxSize' => 500,
);
$this->assertTrue(Validation::uploadedFile($file, $options));
$options = array(
'minSize' => 100,
'maxSize' => 500
);
$this->assertTrue(Validation::uploadedFile($file, $options));
}
/**