2009/3/18 Matthew Weier O'Phinney <[email protected]> > > I think you can pretty much override anything in userland -- $_FILES, > etc.. > > Not true. $_FILES and the various upload file functions provided by PHP > are very... touchy... about being directly manipulated. This has caused > a ton of headaches for Thomas while developing Zend_File_Transfer. >
I do integration test of files upload by copying a template file in /tmp and writing an entry in $_FILES. I have a personal patch (posted on ZF-3791 in the tracker for anyone who wants to use it) that simply substitues move_uploaded_file() and is_uploaded_file() with rename() and 'true' when a static parameter on the Zend_File class (a la Zend_Session) is activated by Zend_Test. Total? 4kb of patch that I apply every time I import zf and see my controller tests fail. When it's time for 2.0 and dependency injection, well, till that, uploading is crucial and I need a way to see if my forms break. -- Giorgio Sironi Piccolo Principe & Ossigeno Scripter http://ossigeno.sourceforge.net
