function PhpTestBase::createNodeWithCode

Creates a test node with PHP code in the body.

Return value

stdObject Node object.

2 calls to PhpTestBase::createNodeWithCode()
PhpAccessTest::testNoPrivileges in drupal/core/modules/php/lib/Drupal/php/Tests/PhpAccessTest.php
Makes sure that the user can't use the PHP filter when not given access.
PhpFilterTest::testPhpFilter in drupal/core/modules/php/lib/Drupal/php/Tests/PhpFilterTest.php
Makes sure that the PHP filter evaluates PHP code when used.

File

drupal/core/modules/php/lib/Drupal/php/Tests/PhpTestBase.php, line 60
Definition of Drupal\php\Tests\PhpTestBase.

Class

PhpTestBase
Defines a base PHP test case class.

Namespace

Drupal\php\Tests

Code

function createNodeWithCode() {
  return $this
    ->drupalCreateNode(array(
    'body' => array(
      array(
        'value' => '<?php print "SimpleTest PHP was executed!"; ?>',
      ),
    ),
  ));
}