How do you test file uploads?

Using, PHPUnit/Selenium, how do you simulate file uploads and testing in your forms? Do you manipulate the $_FILES array manually or is there a more intelligent way of doing it?

bump