CUploadedFile more testfriendly?

Uploading files is pretty important for my project, and although most companies avoid testing it like something with a really bad smell, I took a stab at it.

Unfortunately it is impossible right now to clear the CUploadedFile::$_files-property between test runs, forcing me to switch to process isolation for testing. This obviously increases the test time by a factor 10.

So the question is, as the topic states, is it possible to make CUploadedFile (and imho all components that have a private static that is only initialized once) more unit test friendly?

Please create a ticket with your suggestions and possible solutions: http://code.google.com/p/yii/issues/list. It will help us to decide about it faster.

I found this thread because I ran into the same problem. (Not many threads with the topic file upload testing)

So I was scratching my head how the hell to solve this, then I opened the CUploadedFile.php and looked into it.

There is a reset() method which can be called statically (from 1.1.4).

This is for the other searchers.