Can anybody help me. How to write file upload phpunit testcase? I done it for insert, unique data insertion, delete etc functionality. Following are my code but its not working properly
class FileuploadTest extends PHPUnit_Framework_TestCase
{
public $testFile = array(
name => 2012-04-20 21.13.42.jpg ,
tmp_name => C:wamp mpphp8D20.tmp ,
type => image/jpeg ,
size =>1472190,
error =>0
);
public function testFileupload()
{
$testUpload = new Fileupload;
$testUpload->image = new CUploadedFile($this->testFile[ name ],$this->testFile[ tmp_name ],$this->testFile[ type ],$this->testFile[ size ],$this->testFile[ error ]);
$this->assertFalse($testUpload->validate());
$errors= $testUpload->errors;
$this->assertEmpty($errors);
}
}