josegonzalez/upload — Issue #36: Tests fail due to is_uploaded_file
Author: pdata
Created: 2011-12-20 11:39:22+00:00
State: open

This is a feature request to aid application testing.

I am building tests to prove a model can successfully upload a file using the Upload plugin using https://github.com/davidpersson/media/blob/next/tests/fixtures/test_data.php from the Media plugin to generate the actual upload files on the fly.

The uploads will always fail when testing because handleUploadedFile() correctly uses 'is_uploaded_file()' as a check that the file came via the HTTP POST system. When testing this is not the case, so I would like to propose some sort of config variable or constant which can be used to tell handleUploadedFile() to use rename() instead of is_uploaded_file().

At the moment I am using https://gist.github.com/1501299 as my way of doing it.