diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-04-22 09:57:10 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-04-22 09:57:10 +0000 |
commit | 26395c843fd6e96743cfc929ca01f004a45abfe6 (patch) | |
tree | 6639d0c04c05fa182dafab5b8abbb2fa72c2b32d /modules/php | |
parent | 526401c4c8f7e1a8126c4810a7d7023c4f8bafc5 (diff) | |
download | brdo-26395c843fd6e96743cfc929ca01f004a45abfe6.tar.gz brdo-26395c843fd6e96743cfc929ca01f004a45abfe6.tar.bz2 |
- Patch #308296 by Dave Reid, Damien Tournoud: clean-up of drupalCreateNode().
Diffstat (limited to 'modules/php')
-rw-r--r-- | modules/php/php.test | 18 |
1 files changed, 6 insertions, 12 deletions
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'] = '<?php print "SimpleTest PHP was executed!"; ?>'; - $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' => '<?php print "SimpleTest PHP was executed!"; ?>')); } } @@ -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. |