On Wed, Apr 23, 2008 at 3:35 PM, Piotr Czachur <[EMAIL PROTECTED]> wrote:
> 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 check if file was really uploaded.
>  In my opionion some functions for simulation of file upload in command
>  line script would be very handy for unit testing.
>
>  What I mean is adding a function or a set of functions for setting
>  file upload, for example:
>  do_file_upload( upload_params, upload data).
>
>  This function would be for use only in testing code, so there would be
>  no need to change existing application code to add unit tests, and
>  what's more important it would not leak to security risk.

you can write custom extension for such purposes.
or you can try to separate logical part of your code, from the part,
which interacts with file-uploading and unit-test the logical part


-- 
Alexey Zakhlestin
http://blog.milkfarmsoft.com/

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to