Get a node from the database based on its title.
$title: A node title, usually generated by $this->randomName().
$reset: (optional) Whether to reset the entity cache.
A node entity matching $title.
function drupalGetNodeByTitle($title, $reset = FALSE) {
if ($reset) {
entity_get_controller('node')
->resetCache();
}
$nodes = entity_load_multiple_by_properties('node', array(
'title' => $title,
));
// Load the first node returned from the database.
$returned_node = reset($nodes);
return $returned_node;
}