I'm trying to write a test that will do the following:
- Create a user
- Create an 'article' node
- Upload a file via Media module
- Insert that file into the body via pre-determined markup
- Save the node
- Load file usage info to ascertain usage was incremented on node save.
I know all this stuff works right when I test manually.
I know creating a user, letting that user create an article, and saving the node with custom body text works in the automated test.
I'm stuck on how to upload a file via the Media module's media library, the same way it would do if you pressed the 'media browser' button in a WYSIWYG editor that's set up to work with Media.
Ultimately I'd like to be able to test all the features of the latest patch in this issue: https://drupal.org/node/1268116 .
How do I include this type of file upload in my simpletest? I can't use the built-in file upload field because that would mess up testing of Media's handling of file usage tracking.