mirror of
https://github.com/yiisoft/yii.git
synced 2026-03-20 15:06:54 +01:00
CFileValidator has been fixed.
This commit is contained in:
@@ -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!');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user