Using SimpleTest to test an image upload I have a basic test written (per http://drupal.org/simpletest-tutorial-drupal7) but I am unsure how to proceed to test an image field. 

public function testSimpleTestExampleCreate() {
    // Create node to edit.    
    $edit = array();
    $edit['title'] = $this-&gt;randomName(8);
    $edit["body[und][0][value]"] = $this-&gt;randomName(16);
    $this-&gt;drupalPost('node/add/simpletest-example', $edit, t('Save'));
    $this-&gt;assertText(t('Simpletest Example Node Type @title has been created.', array('@title' =&gt; $edit['title'])));
}


So this will create a node with a title and body. How should I modify this to allow it to test uploading an image as well? Would I just add another key to $edit of 'files[image_image_und_0]' with the path to the image to be uploaded? But I think something else needs to be done since you have to click "Upload" before you save the node.
There is a base image field test class in image.module, which has a uploadNodeImage() method. You can either re-use that by extending from that class or steal the code there.

See testStyleReplacment() for an example of how it is used. 

Edit: The "Upload" is optional and only necessary if you want to upload multiple files. You can always just save the node directly and any selected files will be uploaded and processed.