Skip navigation
Help

DrupalWebTestCase::drupalGetNodeByTitle

7 drupal_web_test_case.php DrupalWebTestCase::drupalGetNodeByTitle($title, $reset = FALSE)

Get a node from the database based on its title.

Parameters

title: A node title, usually generated by $this->randomName().

$reset: (optional) Whether to reset the internal node_load() cache.

Return value

A node object matching $title.

33 calls to DrupalWebTestCase::drupalGetNodeByTitle()

File

drupal/modules/simpletest/drupal_web_test_case.php, line 856

Code

function drupalGetNodeByTitle($title, $reset = FALSE) {
  $nodes = node_load_multiple(array(), array('title' => $title), $reset);
  // Load the first node returned from the database.
  $returned_node = reset($nodes);
  return $returned_node;
}