CFileValidator has been fixed.

This commit is contained in:
Paul Klimov
2013-08-29 11:41:25 +03:00
parent db6e6bc58c
commit 31e7ab1c04
2 changed files with 9 additions and 3 deletions

View File

@@ -39,10 +39,16 @@ class CFileValidatorTest extends CTestCase
public function testValidate()
{
$model = new ValidatorTestModel(__CLASS__);
$uploadedFile = new CUploadedFile('test.txt', __FILE__, 'text/plain', 40, UPLOAD_ERR_OK);
$model->uploaded_file = $uploadedFile;
$this->assertTrue($model->validate(), 'Valid file validation failed!');
}
public function testValidateNoFile()
{
$model = new ValidatorTestModel(__CLASS__);
$uploadedFile = new CUploadedFile('test.txt', __FILE__, 'text/plain', 40, UPLOAD_ERR_NO_FILE);
$model->uploaded_file = $uploadedFile;
$this->assertFalse($model->validate(), 'File with error passed validation!');
}
}