1 backdrop_web_test_case.php BackdropWebTestCase::backdropGetNodeByTitle($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 entity matching $title.

File

core/modules/simpletest/backdrop_web_test_case.php, line 1090

Class

BackdropWebTestCase
Test case for typical Backdrop tests.

Code

function backdropGetNodeByTitle($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;
}