[PHP-DEV] Re: Unable to unit test code containing *_uploaded_file()

2008-05-06 Thread Piotr Czachur
2008/4/23 Piotr Czachur <[EMAIL PROTECTED]>: > Hello! > > I use PHPUnit for unit testing of my application (but this issue is > independent of PHPUnit). Tests are run from command line so it's not > way (that I can imagine) to simulate file upload, because app code > uses is_uploaded_file() to

[PHP-DEV] Re: Unable to unit test code containing *_uploaded_file()

2008-04-24 Thread Maxim Antonov
I think - you can write wrapper for file class file{ public function is_uploaded(){ return SingletonContextObject::isForTestingFileIsUpload() || is_uploaded_file($this->filepath); } } Piotr Czachur пишет: Hello! I use PHPUnit for unit testing of my application (but this issue is independe