diff -Nup simpletest/tests/story_edit.test simpletest/tests/story_edit.test --- simpletest/tests/story_edit.test 1970-01-01 01:00:00.000000000 +0100 +++ simpletest/tests/story_edit.test 2007-11-30 22:06:48.000000000 +0100 @@ -0,0 +1,43 @@ + 'story_preview Edit', + 'desc' => t('We want a working edit for storys, uh?'), + 'group' => 'Node Tests', + ); + } + function testStoryEdit() { + /* Prepare settings */ + $this->drupalVariableSet('node_options_page', array('status', 'promote')); + /* Prepare a user to do the stuff */ + $web_user = $this->drupalCreateUserRolePerm(array('edit own page content', 'create page content')); + $this->drupalLoginUser($web_user); + $edit = array('title'=>$this->randomName(20), + 'body'=>$this->randomName(200)); + + //Create the page to edit + $this->drupalPostRequest('node/add/page', $edit, 'Save'); + + $this->clickLink('Edit'); + + $expectation1 = t('Edit'); + $expectation2 = t($edit['title']); + $expectation3 = t($edit['body']); + + $this->assertWantedText($expectation1, 'Preview text is here'); + $this->assertWantedText($expectation2, 'Hello, the random title'); + $this->assertWantedText($expectation3, 'test is over, the body\'s still there'); + + } + +} + +?> \ Kein Zeilenumbruch am Dateiende. diff -Nup simpletest/tests/story_preview.php simpletest/tests/story_preview.php --- simpletest/tests/story_preview.php 1970-01-01 01:00:00.000000000 +0100 +++ simpletest/tests/story_preview.php 2007-11-30 22:06:48.000000000 +0100 @@ -0,0 +1,40 @@ + 'story_preview Test', + 'desc' => t('We want a working preview for storys, uh?'), + 'group' => 'Node Tests', + ); + } + function testStoryPreview() { + /* Prepare settings */ + $this->drupalVariableSet('node_options_page', array('status', 'promote')); + /* Prepare a user to do the stuff */ + $web_user = $this->drupalCreateUserRolePerm(array('edit own page content', 'create page content')); + $this->drupalLoginUser($web_user); + $edit = array('title'=>$this->randomName(20), + 'body'=>$this->randomName(200)); + + $this->drupalPostRequest('node/add/page', $edit, 'Preview'); + + $expectation1 = t('Preview'); + $expectation2 = t($edit['title']); + $expectation3 = t($edit['body']); + + $this->assertWantedText($expectation1, 'Preview text is here'); + $this->assertWantedText($expectation2, 'Hello, the random title'); + $this->assertWantedText($expectation3, 'test is over, the body\'s still there'); + + } + +} + +?> \ Kein Zeilenumbruch am Dateiende.