'story_edit Test', 'desc' => t('We want a working edit for storys, uh?'), 'group' => 'Node Tests'); } function testStoryEdit() { /* Prepare settings */ $this->drupalVariableSet('node_options_story', array('status', 'promote')); /* Prepare a user to do the stuff */ $web_user = $this->drupalCreateUserRolePerm(array('edit own story content', 'create story content')); $this->drupalLoginUser($web_user); $edit = array( 'title' => '!SimpleTest! test title' . $this->randomName(20), 'body' => '!SimpleTest! test body' . $this->randomName(200)); //Create the page to edit $this->drupalPostRequest('node/add/story', $edit, 'Save'); $node = node_load(array('title' => $edit['title'])); $this->assertNotNull($node, 'Node found in database'); $this->clickLink('Edit'); $this->assertWantedText(t('Edit'), 'Edit text is here'); $this->assertWantedText($edit['title'], 'Hello, the random title'); $this->assertWantedText($edit['body'], 'test is over, the body\'s still there'); $edit = array( 'title' => '!SimpleTest! test title' . $this->randomName(20), 'body' => '!SimpleTest! test body' . $this->randomName(200)); //edit the content of the page $this->drupalPostRequest("node/$node->nid/edit", $edit, 'Save'); $this->assertWantedText($edit['title'], 'Hello, the random title'); $this->assertWantedText($edit['body'], 'test is over, the body\'s still there'); } }