function DrupalWebTestCase::drupalGetNodeByTitle

7.x 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.

35 calls to DrupalWebTestCase::drupalGetNodeByTitle()
BookTestCase::createBookNode in drupal-7.x/modules/book/book.test
Creates a book node.
DBLogTestCase::doNode in drupal-7.x/modules/dblog/dblog.test
Generates and then verifies some node events.
FileFieldWidgetTestCase::testPrivateFileComment in drupal-7.x/modules/file/tests/file.test
Tests that download restrictions on private files work on comments.
FilterAdminTestCase::testFilterAdmin in drupal-7.x/modules/filter/filter.test
Tests filter administration functionality.
FilterFormatAccessTestCase::testFormatWidgetPermissions in drupal-7.x/modules/filter/filter.test
Tests editing a page using a disallowed text format.

... See full list

File

drupal-7.x/modules/simpletest/drupal_web_test_case.php, line 913

Class

DrupalWebTestCase
Test case for typical Drupal tests.

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;
}