You are here

function PathModuleTestCase::createNode in SimpleTest 6

2 calls to PathModuleTestCase::createNode()
PathModuleTestCase::testAdminAlias in tests/path_module.test
Test alias functionality through the admin interfaces.
PathModuleTestCase::testNodeAlias in tests/path_module.test
Test alias functionality through the node interfaces.

File

tests/path_module.test, line 130

Class

PathModuleTestCase

Code

function createNode() {
  $this
    ->drupalVariableSet('node_options_page', array(
    'status',
    'promote',
  ));
  $edit = array();
  $edit['title'] = '!SimpleTest test node! ' . $this
    ->randomName(10);
  $edit['body'] = '!SimpleTest test body! ' . $this
    ->randomName(32) . ' ' . $this
    ->randomName(32);
  $this
    ->drupalPost('node/add/page', $edit, 'Save');

  // check to make sure the node was created
  $node = node_load(array(
    'title' => $edit['title'],
  ));
  $this
    ->assertNotNull($node === FALSE ? NULL : $node, 'Node found in database. %s');
  return $node;
}