function PHPTestCase::createNodeWithCode in Drupal 7
Creates a test node with PHP code in the body.
Return value
stdObject Node object.
2 calls to PHPTestCase::createNodeWithCode()
- PHPAccessTestCase::testNoPrivileges in modules/
php/ php.test - Makes sure that the user can't use the PHP filter when not given access.
- PHPFilterTestCase::testPHPFilter in modules/
php/ php.test - Makes sure that the PHP filter evaluates PHP code when used.
File
- modules/
php/ php.test, line 45 - Tests for php.module.
Class
- PHPTestCase
- Defines a base PHP test case class.
Code
function createNodeWithCode() {
return $this
->drupalCreateNode(array(
'body' => array(
LANGUAGE_NONE => array(
array(
'value' => '<?php print "SimpleTest PHP was executed!"; ?>',
),
),
),
));
}