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->randomName(8);
$edit["body[und][0][value]"] = $this->randomName(16);
$this->drupalPost('node/add/simpletest-example', $edit, t('Save'));
$this->assertText(t('Simpletest Example Node Type @title has been created.', array('@title' => $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.