function DrupalWebTestCase::drupalGetNodeByTitle

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.

74 calls to DrupalWebTestCase::drupalGetNodeByTitle()
BookTestCase::createBookNode in drupal-7.x/modules/book/book.test
Creates a book node.
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.
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.

... See full list

Archivo

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

Class

DrupalWebTestCase
Test case for typical Drupal tests.

Código

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