How can one best test a controller action which receives a file upload using Zend_Test_PHPUnit_ControllerTestCase?
Ideally, $this->getRequest()->setPost() would take a filename in the data array, but this does not seem to be supported.
I would be willing at this stage to bootstrap/run my application on the command line and create a request object to pass to the front controller. This would bypass Zend_Test_PHPUnit_ControllerTestCase, but I could subsequently check that the file was uploaded properly through a subsequent $this->dispatch('/some/url') in the ControllerTestCase. However, I am also stumped as to how to get a file into the request object using this method.
The only thing I can think to try right now is to bring up an HTTP server via the command line which points to the app (APPLICATION_ENV='testing') and do a file upload via Zend's Http Client or CURL or something. That doesn't strike me as very elegant.
Anyone else had to deal with this issue?
Thanks!