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.

40 calls to DrupalWebTestCase::drupalGetNodeByTitle()
BookTestCase::createBookNode in drupal/modules/book/book.test
Creates a book node.
DBLogTestCase::doNode in drupal/modules/dblog/dblog.test
Generates and then verifies some node events.
FileFieldWidgetTestCase::doTestTemporaryFileRemovalExploit in drupal/modules/file/tests/file.test
Helper for testing exploiting the temporary file removal using fid.
FileFieldWidgetTestCase::testPrivateFileComment in drupal/modules/file/tests/file.test
Tests that download restrictions on private files work on comments.
FilePrivateTestCase::testPrivateFile in drupal/modules/file/tests/file.test
Tests file access for file uploaded to a private node.

... See full list

File

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

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