From 26395c843fd6e96743cfc929ca01f004a45abfe6 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 22 Apr 2009 09:57:10 +0000 Subject: - Patch #308296 by Dave Reid, Damien Tournoud: clean-up of drupalCreateNode(). --- modules/php/php.test | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'modules/php') diff --git a/modules/php/php.test b/modules/php/php.test index 487c5a5d6..bf1ea6a24 100644 --- a/modules/php/php.test +++ b/modules/php/php.test @@ -20,16 +20,10 @@ class PHPTestCase extends DrupalWebTestCase { /** * Create a test node with PHP code in the body. * - * @param stdObject User object to create node for. * @return stdObject Node object. */ - function createNodeWithCode($user) { - $node = $this->drupalCreateNode(array('uid' => $user->uid)); - $edit = array(); - $edit['body'] = ''; - $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save')); - $this->assertRaw(t('Page %title has been updated.', array('%title' => $node->title)), t('PHP code inserted into node.')); - return $node; + function createNodeWithCode() { + return $this->drupalCreateNode(array('body' => '')); } } @@ -58,10 +52,10 @@ class PHPFilterTestCase extends PHPTestCase { // Create node with PHP filter enabled. $web_user = $this->drupalCreateUser(array('access content', 'create page content', 'edit own page content')); $this->drupalLogin($web_user); - - $node = $this->createNodeWithCode($web_user); + $node = $this->createNodeWithCode(); // Make sure that the PHP code shows up as text. + $this->drupalGet('node/'. $node->nid); $this->assertText('print', t('PHP code is displayed.')); // Change filter to PHP filter and see that PHP code is evaluated. @@ -95,10 +89,10 @@ class PHPAccessTestCase extends PHPTestCase { // Create node with PHP filter enabled. $web_user = $this->drupalCreateUser(array('access content', 'create page content', 'edit own page content')); $this->drupalLogin($web_user); - - $node = $this->createNodeWithCode($web_user); + $node = $this->createNodeWithCode(); // Make sure that the PHP code shows up as text. + $this->drupalGet('node/'. $node->nid); $this->assertText('print', t('PHP code is displayed.')); // Make sure that user doesn't have access to filter. -- cgit v1.2.3