Commit 268b7058 authored by webchick's avatar webchick
Browse files

Issue #1616962 by fgm, rvilar, kalman.hosszu, fubhy: Replace ->title with ->label().

parent 353eb10c
...@@ -4633,8 +4633,8 @@ function _form_set_class(&$element, $class = array()) { ...@@ -4633,8 +4633,8 @@ function _form_set_class(&$element, $class = array()) {
* // and the batch processing can continue to the next operation. * // and the batch processing can continue to the next operation.
* *
* $node = node_load(array('uid' => $uid, 'type' => $type)); * $node = node_load(array('uid' => $uid, 'type' => $type));
* $context['results'][] = $node->nid . ' : ' . check_plain($node->title); * $context['results'][] = $node->nid . ' : ' . check_plain($node->label());
* $context['message'] = check_plain($node->title); * $context['message'] = check_plain($node->label());
* } * }
* *
* // More advanced example: multi-step operation - load all nodes, five by five * // More advanced example: multi-step operation - load all nodes, five by five
...@@ -4653,10 +4653,10 @@ function _form_set_class(&$element, $class = array()) { ...@@ -4653,10 +4653,10 @@ function _form_set_class(&$element, $class = array()) {
* ->execute(); * ->execute();
* foreach ($result as $row) { * foreach ($result as $row) {
* $node = node_load($row->nid, NULL, TRUE); * $node = node_load($row->nid, NULL, TRUE);
* $context['results'][] = $node->nid . ' : ' . check_plain($node->title); * $context['results'][] = $node->nid . ' : ' . check_plain($node->label());
* $context['sandbox']['progress']++; * $context['sandbox']['progress']++;
* $context['sandbox']['current_node'] = $node->nid; * $context['sandbox']['current_node'] = $node->nid;
* $context['message'] = check_plain($node->title); * $context['message'] = check_plain($node->label());
* } * }
* if ($context['sandbox']['progress'] != $context['sandbox']['max']) { * if ($context['sandbox']['progress'] != $context['sandbox']['max']) {
* $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max']; * $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];
......
...@@ -77,7 +77,7 @@ function book_admin_settings_validate($form, &$form_state) { ...@@ -77,7 +77,7 @@ function book_admin_settings_validate($form, &$form_state) {
* @ingroup forms * @ingroup forms
*/ */
function book_admin_edit($form, $form_state, Node $node) { function book_admin_edit($form, $form_state, Node $node) {
drupal_set_title($node->title); drupal_set_title($node->label());
$form['#node'] = $node; $form['#node'] = $node;
_book_admin_table($node, $form); _book_admin_table($node, $form);
$form['save'] = array( $form['save'] = array(
...@@ -138,12 +138,12 @@ function book_admin_edit_submit($form, &$form_state) { ...@@ -138,12 +138,12 @@ function book_admin_edit_submit($form, &$form_state) {
$node->log = t('Title changed from %original to %current.', array('%original' => $node->title, '%current' => $values['title'])); $node->log = t('Title changed from %original to %current.', array('%original' => $node->title, '%current' => $values['title']));
$node->save(); $node->save();
watchdog('content', 'book: updated %title.', array('%title' => $node->title), WATCHDOG_NOTICE, l(t('view'), 'node/' . $node->nid)); watchdog('content', 'book: updated %title.', array('%title' => $node->label()), WATCHDOG_NOTICE, l(t('view'), 'node/' . $node->nid));
} }
} }
} }
drupal_set_message(t('Updated book %title.', array('%title' => $form['#node']->title))); drupal_set_message(t('Updated book %title.', array('%title' => $form['#node']->label())));
} }
/** /**
......
...@@ -570,7 +570,7 @@ function _book_add_form_elements(&$form, &$form_state, Node $node) { ...@@ -570,7 +570,7 @@ function _book_add_form_elements(&$form, &$form_state, Node $node) {
if (isset($node->nid) && ($nid == $node->book['original_bid']) && ($node->book['parent_depth_limit'] == 0)) { if (isset($node->nid) && ($nid == $node->book['original_bid']) && ($node->book['parent_depth_limit'] == 0)) {
// This is the top level node in a maximum depth book and thus cannot be moved. // This is the top level node in a maximum depth book and thus cannot be moved.
$options[$node->nid] = $node->title; $options[$node->nid] = $node->label();
} }
else { else {
foreach (book_get_books() as $book) { foreach (book_get_books() as $book) {
...@@ -639,7 +639,7 @@ function _book_update_outline(Node $node) { ...@@ -639,7 +639,7 @@ function _book_update_outline(Node $node) {
$new = empty($node->book['mlid']); $new = empty($node->book['mlid']);
$node->book['link_path'] = 'node/' . $node->nid; $node->book['link_path'] = 'node/' . $node->nid;
$node->book['link_title'] = $node->title; $node->book['link_title'] = $node->label();
$node->book['parent_mismatch'] = FALSE; // The normal case. $node->book['parent_mismatch'] = FALSE; // The normal case.
if ($node->book['bid'] == $node->nid) { if ($node->book['bid'] == $node->nid) {
...@@ -1044,7 +1044,7 @@ function book_form_node_delete_confirm_alter(&$form, $form_state) { ...@@ -1044,7 +1044,7 @@ function book_form_node_delete_confirm_alter(&$form, $form_state) {
if (isset($node->book) && $node->book['has_children']) { if (isset($node->book) && $node->book['has_children']) {
$form['book_warning'] = array( $form['book_warning'] = array(
'#markup' => '<p>' . t('%title is part of a book outline, and has associated child pages. If you proceed with deletion, the child pages will be relocated automatically.', array('%title' => $node->title)) . '</p>', '#markup' => '<p>' . t('%title is part of a book outline, and has associated child pages. If you proceed with deletion, the child pages will be relocated automatically.', array('%title' => $node->label())) . '</p>',
'#weight' => -10, '#weight' => -10,
); );
} }
...@@ -1319,7 +1319,7 @@ function book_node_export(Node $node, $children = '') { ...@@ -1319,7 +1319,7 @@ function book_node_export(Node $node, $children = '') {
*/ */
function template_preprocess_book_node_export_html(&$variables) { function template_preprocess_book_node_export_html(&$variables) {
$variables['depth'] = $variables['node']->book['depth']; $variables['depth'] = $variables['node']->book['depth'];
$variables['title'] = check_plain($variables['node']->title); $variables['title'] = check_plain($variables['node']->label());
$variables['content'] = $variables['node']->rendered; $variables['content'] = $variables['node']->rendered;
} }
......
...@@ -83,7 +83,7 @@ function book_export_html($nid) { ...@@ -83,7 +83,7 @@ function book_export_html($nid) {
if (isset($node->book)) { if (isset($node->book)) {
$tree = book_menu_subtree_data($node->book); $tree = book_menu_subtree_data($node->book);
$contents = book_export_traverse($tree, 'book_node_export'); $contents = book_export_traverse($tree, 'book_node_export');
return theme('book_export_html', array('title' => $node->title, 'contents' => $contents, 'depth' => $node->book['depth'])); return theme('book_export_html', array('title' => $node->label(), 'contents' => $contents, 'depth' => $node->book['depth']));
} }
else { else {
throw new NotFoundHttpException(); throw new NotFoundHttpException();
...@@ -103,7 +103,7 @@ function book_export_html($nid) { ...@@ -103,7 +103,7 @@ function book_export_html($nid) {
* @see book_menu() * @see book_menu()
*/ */
function book_outline(Node $node) { function book_outline(Node $node) {
drupal_set_title($node->title); drupal_set_title($node->label());
return drupal_get_form('book_outline_form', $node); return drupal_get_form('book_outline_form', $node);
} }
...@@ -210,7 +210,7 @@ function book_outline_form_submit($form, &$form_state) { ...@@ -210,7 +210,7 @@ function book_outline_form_submit($form, &$form_state) {
*/ */
function book_remove_form($form, &$form_state, Node $node) { function book_remove_form($form, &$form_state, Node $node) {
$form['#node'] = $node; $form['#node'] = $node;
$title = array('%title' => $node->title); $title = array('%title' => $node->label());
if ($node->book['has_children']) { if ($node->book['has_children']) {
$description = t('%title has associated child pages, which will be relocated automatically to maintain their connection to the book. To recreate the hierarchy (as it was before removing this page), %title may be added again using the Outline tab, and each of its former child pages will need to be relocated manually.', $title); $description = t('%title has associated child pages, which will be relocated automatically to maintain their connection to the book. To recreate the hierarchy (as it was before removing this page), %title may be added again using the Outline tab, and each of its former child pages will need to be relocated manually.', $title);
......
...@@ -142,15 +142,15 @@ function checkBookNode(Node $node, $nodes, $previous = FALSE, $up = FALSE, $next ...@@ -142,15 +142,15 @@ function checkBookNode(Node $node, $nodes, $previous = FALSE, $up = FALSE, $next
// Check previous, up, and next links. // Check previous, up, and next links.
if ($previous) { if ($previous) {
$this->assertRaw(l('<b>‹</b> ' . $previous->title, 'node/' . $previous->nid, array('html'=> TRUE, 'attributes' => array('rel' => array('prev'), 'title' => t('Go to previous page')))), t('Previous page link found.')); $this->assertRaw(l('<b>‹</b> ' . $previous->label(), 'node/' . $previous->nid, array('html' => TRUE, 'attributes' => array('rel' => array('prev'), 'title' => t('Go to previous page')))), t('Previous page link found.'));
} }
if ($up) { if ($up) {
$this->assertRaw(l('up', 'node/' . $up->nid, array('html'=> TRUE,'attributes' => array('title' => t('Go to parent page')))), t('Up page link found.')); $this->assertRaw(l('up', 'node/' . $up->nid, array('html'=> TRUE, 'attributes' => array('title' => t('Go to parent page')))), t('Up page link found.'));
} }
if ($next) { if ($next) {
$this->assertRaw(l($next->title . ' <b>›</b>', 'node/' . $next->nid, array('html'=> TRUE, 'attributes' => array('rel' => array('next'), 'title' => t('Go to next page')))), t('Next page link found.')); $this->assertRaw(l($next->label() . ' <b>›</b>', 'node/' . $next->nid, array('html'=> TRUE, 'attributes' => array('rel' => array('next'), 'title' => t('Go to next page')))), t('Next page link found.'));
} }
// Compute the expected breadcrumb. // Compute the expected breadcrumb.
...@@ -172,7 +172,7 @@ function checkBookNode(Node $node, $nodes, $previous = FALSE, $up = FALSE, $next ...@@ -172,7 +172,7 @@ function checkBookNode(Node $node, $nodes, $previous = FALSE, $up = FALSE, $next
// Check printer friendly version. // Check printer friendly version.
$this->drupalGet('book/export/html/' . $node->nid); $this->drupalGet('book/export/html/' . $node->nid);
$this->assertText($node->title, t('Printer friendly title found.')); $this->assertText($node->label(), t('Printer friendly title found.'));
$this->assertRaw(check_markup($node->body[LANGUAGE_NOT_SPECIFIED][0]['value'], $node->body[LANGUAGE_NOT_SPECIFIED][0]['format']), t('Printer friendly body found.')); $this->assertRaw(check_markup($node->body[LANGUAGE_NOT_SPECIFIED][0]['value'], $node->body[LANGUAGE_NOT_SPECIFIED][0]['format']), t('Printer friendly body found.'));
$number++; $number++;
...@@ -186,7 +186,7 @@ function checkBookNode(Node $node, $nodes, $previous = FALSE, $up = FALSE, $next ...@@ -186,7 +186,7 @@ function checkBookNode(Node $node, $nodes, $previous = FALSE, $up = FALSE, $next
function generateOutlinePattern($nodes) { function generateOutlinePattern($nodes) {
$outline = ''; $outline = '';
foreach ($nodes as $node) { foreach ($nodes as $node) {
$outline .= '(node\/' . $node->nid . ')(.*?)(' . $node->title . ')(.*?)'; $outline .= '(node\/' . $node->nid . ')(.*?)(' . $node->label() . ')(.*?)';
} }
return '/<nav id="book-navigation-' . $this->book->nid . '"(.*?)<ul(.*?)' . $outline . '<\/ul>/s'; return '/<nav id="book-navigation-' . $this->book->nid . '"(.*?)<ul(.*?)' . $outline . '<\/ul>/s';
...@@ -241,7 +241,7 @@ function testBookExport() { ...@@ -241,7 +241,7 @@ function testBookExport() {
// Make sure each part of the book is there. // Make sure each part of the book is there.
foreach ($nodes as $node) { foreach ($nodes as $node) {
$this->assertText($node->title, t('Node title found in printer friendly version.')); $this->assertText($node->label(), t('Node title found in printer friendly version.'));
$this->assertRaw(check_markup($node->body[LANGUAGE_NOT_SPECIFIED][0]['value'], $node->body[LANGUAGE_NOT_SPECIFIED][0]['format']), t('Node body found in printer friendly version.')); $this->assertRaw(check_markup($node->body[LANGUAGE_NOT_SPECIFIED][0]['value'], $node->body[LANGUAGE_NOT_SPECIFIED][0]['format']), t('Node body found in printer friendly version.'));
} }
...@@ -292,8 +292,8 @@ function testBookNavigationBlock() { ...@@ -292,8 +292,8 @@ function testBookNavigationBlock() {
$nodes = $this->createBook(); $nodes = $this->createBook();
$this->drupalGet('<front>'); $this->drupalGet('<front>');
$this->assertText($block_title, t('Book navigation block is displayed.')); $this->assertText($block_title, t('Book navigation block is displayed.'));
$this->assertText($this->book->title, t('Link to book root (@title) is displayed.', array('@title' => $nodes[0]->title))); $this->assertText($this->book->label(), t('Link to book root (@title) is displayed.', array('@title' => $nodes[0]->label())));
$this->assertNoText($nodes[0]->title, t('No links to individual book pages are displayed.')); $this->assertNoText($nodes[0]->label(), t('No links to individual book pages are displayed.'));
} }
/** /**
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
*/ */
function comment_reply(Node $node, $pid = NULL) { function comment_reply(Node $node, $pid = NULL) {
// Set the breadcrumb trail. // Set the breadcrumb trail.
drupal_set_breadcrumb(array(l(t('Home'), NULL), l($node->title, 'node/' . $node->nid))); drupal_set_breadcrumb(array(l(t('Home'), NULL), l($node->label(), 'node/' . $node->nid)));
$op = isset($_POST['op']) ? $_POST['op'] : ''; $op = isset($_POST['op']) ? $_POST['op'] : '';
$build = array(); $build = array();
......
...@@ -195,7 +195,7 @@ function comment_tokens($type, $tokens, array $data = array(), array $options = ...@@ -195,7 +195,7 @@ function comment_tokens($type, $tokens, array $data = array(), array $options =
case 'node': case 'node':
$node = node_load($comment->nid); $node = node_load($comment->nid);
$title = $node->title; $title = $node->label();
$replacements[$original] = $sanitize ? filter_xss($title) : $title; $replacements[$original] = $sanitize ? filter_xss($title) : $title;
break; break;
} }
......
...@@ -531,7 +531,7 @@ private function verifyForums($node_user, Node $node, $admin, $response = 200) { ...@@ -531,7 +531,7 @@ private function verifyForums($node_user, Node $node, $admin, $response = 200) {
// View forum node. // View forum node.
$this->drupalGet('node/' . $node->nid); $this->drupalGet('node/' . $node->nid);
$this->assertResponse(200); $this->assertResponse(200);
$this->assertTitle($node->title . ' | Drupal', t('Forum node was displayed')); $this->assertTitle($node->label() . ' | Drupal', t('Forum node was displayed'));
$breadcrumb = array( $breadcrumb = array(
l(t('Home'), NULL), l(t('Home'), NULL),
l(t('Forums'), 'forum'), l(t('Forums'), 'forum'),
...@@ -544,7 +544,7 @@ private function verifyForums($node_user, Node $node, $admin, $response = 200) { ...@@ -544,7 +544,7 @@ private function verifyForums($node_user, Node $node, $admin, $response = 200) {
$this->drupalGet('node/' . $node->nid . '/edit'); $this->drupalGet('node/' . $node->nid . '/edit');
$this->assertResponse($response); $this->assertResponse($response);
if ($response == 200) { if ($response == 200) {
$this->assertTitle('Edit Forum topic ' . $node->title . ' | Drupal', t('Forum edit node was displayed')); $this->assertTitle('Edit Forum topic ' . $node->label() . ' | Drupal', t('Forum edit node was displayed'));
} }
if ($response == 200) { if ($response == 200) {
......
...@@ -86,11 +86,11 @@ function testPathLanguageConfiguration() { ...@@ -86,11 +86,11 @@ function testPathLanguageConfiguration() {
// Confirm English language path alias works. // Confirm English language path alias works.
$this->drupalGet($english_path); $this->drupalGet($english_path);
$this->assertText($node->title, t('English alias works.')); $this->assertText($node->label(), t('English alias works.'));
// Confirm custom language path alias works. // Confirm custom language path alias works.
$this->drupalGet($prefix . '/' . $custom_language_path); $this->drupalGet($prefix . '/' . $custom_language_path);
$this->assertText($node->title, t('Custom language alias works.')); $this->assertText($node->label(), t('Custom language alias works.'));
// Create a custom path. // Create a custom path.
$custom_path = $this->randomName(8); $custom_path = $this->randomName(8);
...@@ -132,18 +132,18 @@ function testPathLanguageConfiguration() { ...@@ -132,18 +132,18 @@ function testPathLanguageConfiguration() {
// Test that both node titles link to our path alias. // Test that both node titles link to our path alias.
$this->drupalGet('<front>'); $this->drupalGet('<front>');
$custom_path_url = base_path() . $GLOBALS['script_path'] . $custom_path; $custom_path_url = base_path() . $GLOBALS['script_path'] . $custom_path;
$elements = $this->xpath('//a[@href=:href and .=:title]', array(':href' => $custom_path_url, ':title' => $first_node->title)); $elements = $this->xpath('//a[@href=:href and .=:title]', array(':href' => $custom_path_url, ':title' => $first_node->label()));
$this->assertTrue(!empty($elements), t('First node links to the path alias.')); $this->assertTrue(!empty($elements), t('First node links to the path alias.'));
$elements = $this->xpath('//a[@href=:href and .=:title]', array(':href' => $custom_path_url, ':title' => $second_node->title)); $elements = $this->xpath('//a[@href=:href and .=:title]', array(':href' => $custom_path_url, ':title' => $second_node->label()));
$this->assertTrue(!empty($elements), t('Second node links to the path alias.')); $this->assertTrue(!empty($elements), t('Second node links to the path alias.'));
// Confirm that the custom path leads to the first node. // Confirm that the custom path leads to the first node.
$this->drupalGet($custom_path); $this->drupalGet($custom_path);
$this->assertText($first_node->title, t('Custom alias returns first node.')); $this->assertText($first_node->label(), t('Custom alias returns first node.'));
// Confirm that the custom path with prefix leads to the second node. // Confirm that the custom path with prefix leads to the second node.
$this->drupalGet($prefix . '/' . $custom_path); $this->drupalGet($prefix . '/' . $custom_path);
$this->assertText($second_node->title, t('Custom alias with prefix returns second node.')); $this->assertText($second_node->label(), t('Custom alias with prefix returns second node.'));
} }
} }
...@@ -355,7 +355,7 @@ function verifyMenuLink($item, $item_node, $parent = NULL, $parent_node = NULL) ...@@ -355,7 +355,7 @@ function verifyMenuLink($item, $item_node, $parent = NULL, $parent_node = NULL)
// Verify menu link link. // Verify menu link link.
$this->clickLink($title); $this->clickLink($title);
$title = $parent_node->title; $title = $parent_node->label();
$this->assertTitle(t("@title | Drupal", array('@title' => $title)), t('Parent menu link link target was correct')); $this->assertTitle(t("@title | Drupal", array('@title' => $title)), t('Parent menu link link target was correct'));
} }
...@@ -365,7 +365,7 @@ function verifyMenuLink($item, $item_node, $parent = NULL, $parent_node = NULL) ...@@ -365,7 +365,7 @@ function verifyMenuLink($item, $item_node, $parent = NULL, $parent_node = NULL)
// Verify menu link link. // Verify menu link link.
$this->clickLink($title); $this->clickLink($title);
$title = $item_node->title; $title = $item_node->label();
$this->assertTitle(t("@title | Drupal", array('@title' => $title)), t('Menu link link target was correct')); $this->assertTitle(t("@title | Drupal", array('@title' => $title)), t('Menu link link target was correct'));
} }
......
...@@ -54,7 +54,7 @@ public function testCommentPager() { ...@@ -54,7 +54,7 @@ public function testCommentPager() {
// View the node page. With the default 50 comments per page there should // View the node page. With the default 50 comments per page there should
// be two pages (0, 1) but no third (2) page. // be two pages (0, 1) but no third (2) page.
$this->drupalGet('node/' . $node->nid); $this->drupalGet('node/' . $node->nid);
$this->assertText($node->title, t('Node title found.')); $this->assertText($node->label(), t('Node title found.'));
$this->assertText(t('Comments'), t('Has a comments section.')); $this->assertText(t('Comments'), t('Has a comments section.'));
$this->assertRaw('page=1', t('Secound page exists.')); $this->assertRaw('page=1', t('Secound page exists.'));
$this->assertNoRaw('page=2', t('No third page exists.')); $this->assertNoRaw('page=2', t('No third page exists.'));
......
...@@ -85,12 +85,12 @@ function testRecentNodeBlock() { ...@@ -85,12 +85,12 @@ function testRecentNodeBlock() {
// Test that only the 2 latest nodes are shown. // Test that only the 2 latest nodes are shown.
$this->drupalLogin($this->web_user); $this->drupalLogin($this->web_user);
$this->assertNoText($node1->title, t('Node not found in block.')); $this->assertNoText($node1->label(), t('Node not found in block.'));
$this->assertText($node2->title, t('Node found in block.')); $this->assertText($node2->label(), t('Node found in block.'));
$this->assertText($node3->title, t('Node found in block.')); $this->assertText($node3->label(), t('Node found in block.'));
// Check to make sure nodes are in the right order. // Check to make sure nodes are in the right order.
$this->assertTrue($this->xpath('//div[@id="block-node-recent"]/div/table/tbody/tr[position() = 1]/td/div/a[text() = "' . $node3->title . '"]'), t('Nodes were ordered correctly in block.')); $this->assertTrue($this->xpath('//div[@id="block-node-recent"]/div/table/tbody/tr[position() = 1]/td/div/a[text() = "' . $node3->label() . '"]'), t('Nodes were ordered correctly in block.'));
// Set the number of recent nodes to show to 10. // Set the number of recent nodes to show to 10.
$this->drupalLogout(); $this->drupalLogout();
...@@ -109,10 +109,10 @@ function testRecentNodeBlock() { ...@@ -109,10 +109,10 @@ function testRecentNodeBlock() {
// Test that all four nodes are shown. // Test that all four nodes are shown.
$this->drupalGet(''); $this->drupalGet('');
$this->assertText($node1->title, t('Node found in block.')); $this->assertText($node1->label(), t('Node found in block.'));
$this->assertText($node2->title, t('Node found in block.')); $this->assertText($node2->label(), t('Node found in block.'));
$this->assertText($node3->title, t('Node found in block.')); $this->assertText($node3->label(), t('Node found in block.'));
$this->assertText($node4->title, t('Node found in block.')); $this->assertText($node4->label(), t('Node found in block.'));
// Create the custom block. // Create the custom block.
$custom_block = array(); $custom_block = array();
......
...@@ -37,15 +37,15 @@ function testNodeMultipleLoad() { ...@@ -37,15 +37,15 @@ function testNodeMultipleLoad() {
// Confirm that promoted nodes appear in the default node listing. // Confirm that promoted nodes appear in the default node listing.
$this->drupalGet('node'); $this->drupalGet('node');
$this->assertText($node1->title, t('Node title appears on the default listing.')); $this->assertText($node1->label(), t('Node title appears on the default listing.'));
$this->assertText($node2->title, t('Node title appears on the default listing.')); $this->assertText($node2->label(), t('Node title appears on the default listing.'));
$this->assertNoText($node3->title, t('Node title does not appear in the default listing.')); $this->assertNoText($node3->label(), t('Node title does not appear in the default listing.'));
$this->assertNoText($node4->title, t('Node title does not appear in the default listing.')); $this->assertNoText($node4->label(), t('Node title does not appear in the default listing.'));
// Load nodes with only a condition. Nodes 3 and 4 will be loaded. // Load nodes with only a condition. Nodes 3 and 4 will be loaded.
$nodes = node_load_multiple(FALSE, array('promote' => 0)); $nodes = node_load_multiple(FALSE, array('promote' => 0));
$this->assertEqual($node3->title, $nodes[$node3->nid]->title, t('Node was loaded.')); $this->assertEqual($node3->label(), $nodes[$node3->nid]->label(), t('Node was loaded.'));
$this->assertEqual($node4->title, $nodes[$node4->nid]->title, t('Node was loaded.')); $this->assertEqual($node4->label(), $nodes[$node4->nid]->label(), t('Node was loaded.'));
$count = count($nodes); $count = count($nodes);
$this->assertTrue($count == 2, t('@count nodes loaded.', array('@count' => $count))); $this->assertTrue($count == 2, t('@count nodes loaded.', array('@count' => $count)));
...@@ -64,9 +64,9 @@ function testNodeMultipleLoad() { ...@@ -64,9 +64,9 @@ function testNodeMultipleLoad() {
$nodes = node_load_multiple(array(1, 2, 3, 4), array('type' => 'article')); $nodes = node_load_multiple(array(1, 2, 3, 4), array('type' => 'article'));
$count = count($nodes); $count = count($nodes);
$this->assertTrue($count == 3, t('@count nodes loaded', array('@count' => $count))); $this->assertTrue($count == 3, t('@count nodes loaded', array('@count' => $count)));
$this->assertEqual($nodes[$node1->nid]->title, $node1->title, t('Node successfully loaded.')); $this->assertEqual($nodes[$node1->nid]->label(), $node1->label(), t('Node successfully loaded.'));
$this->assertEqual($nodes[$node2->nid]->title, $node2->title, t('Node successfully loaded.')); $this->assertEqual($nodes[$node2->nid]->label(), $node2->label(), t('Node successfully loaded.'));
$this->assertEqual($nodes[$node3->nid]->title, $node3->title, t('Node successfully loaded.')); $this->assertEqual($nodes[$node3->nid]->label(), $node3->label(), t('Node successfully loaded.'));
$this->assertFalse(isset($nodes[$node4->nid])); $this->assertFalse(isset($nodes[$node4->nid]));
// Now that all nodes have been loaded into the static cache, ensure that // Now that all nodes have been loaded into the static cache, ensure that
...@@ -74,15 +74,15 @@ function testNodeMultipleLoad() { ...@@ -74,15 +74,15 @@ function testNodeMultipleLoad() {
$nodes = node_load_multiple(array(1, 2, 3, 4), array('type' => 'article')); $nodes = node_load_multiple(array(1, 2, 3, 4), array('type' => 'article'));
$count = count($nodes); $count = count($nodes);
$this->assertTrue($count == 3, t('@count nodes loaded.', array('@count' => $count))); $this->assertTrue($count == 3, t('@count nodes loaded.', array('@count' => $count)));
$this->assertEqual($nodes[$node1->nid]->title, $node1->title, t('Node successfully loaded')); $this->assertEqual($nodes[$node1->nid]->label(), $node1->label(), t('Node successfully loaded'));
$this->assertEqual($nodes[$node2->nid]->title, $node2->title, t('Node successfully loaded')); $this->assertEqual($nodes[$node2->nid]->label(), $node2->label(), t('Node successfully loaded'));
$this->assertEqual($nodes[$node3->nid]->title, $node3->title, t('Node successfully loaded')); $this->assertEqual($nodes[$node3->nid]->label(), $node3->label(), t('Node successfully loaded'));
$this->assertFalse(isset($nodes[$node4->nid]), t('Node was not loaded')); $this->assertFalse(isset($nodes[$node4->nid]), t('Node was not loaded'));
// Load nodes by nid, where type = article and promote = 0. // Load nodes by nid, where type = article and promote = 0.
$nodes = node_load_multiple(array(1, 2, 3, 4), array('type' => 'article', 'promote' => 0)); $nodes = node_load_multiple(array(1, 2, 3, 4), array('type' => 'article', 'promote' => 0));
$count = count($nodes); $count = count($nodes);
$this->assertTrue($count == 1, t('@count node loaded', array('@count' => $count))); $this->assertTrue($count == 1, t('@count node loaded', array('@count' => $count)));
$this->assertEqual($nodes[$node3->nid]->title, $node3->title, t('Node successfully loaded.')); $this->assertEqual($nodes[$node3->nid]->label(), $node3->label(), t('Node successfully loaded.'));
} }
} }
...@@ -81,7 +81,7 @@ function testRevisions() { ...@@ -81,7 +81,7 @@ function testRevisions() {
// Confirm that revisions revert properly. // Confirm that revisions revert properly.
$this->drupalPost("node/$node->nid/revisions/{$nodes[1]->vid}/revert", array(), t('Revert')); $this->drupalPost("node/$node->nid/revisions/{$nodes[1]->vid}/revert", array(), t('Revert'));
$this->assertRaw(t('@type %title has been reverted back to the revision from %revision-date.', $this->assertRaw(t('@type %title has been reverted back to the revision from %revision-date.',
array('@type' => 'Basic page', '%title' => $nodes[1]->title, array('@type' => 'Basic page', '%title' => $nodes[1]->label(),
'%revision-date' => format_date($nodes[1]->revision_timestamp))), t('Revision reverted.')); '%revision-date' => format_date($nodes[1]->revision_timestamp))), t('Revision reverted.'));
$reverted_node = node_load($node->nid); $reverted_node = node_load($node->nid);
$this->assertTrue(($nodes[1]->body[LANGUAGE_NOT_SPECIFIED][0]['value'] == $reverted_node->body[LANGUAGE_NOT_SPECIFIED][0]['value']), t('Node reverted correctly.')); $this->assertTrue(($nodes[1]->body[LANGUAGE_NOT_SPECIFIED][0]['value'] == $reverted_node->body[LANGUAGE_NOT_SPECIFIED][0]['value']), t('Node reverted correctly.'));
...@@ -94,7 +94,7 @@ function testRevisions() { ...@@ -94,7 +94,7 @@ function testRevisions() {
$this->drupalPost("node/$node->nid/revisions/{$nodes[1]->vid}/delete", array(), t('Delete')); $this->drupalPost("node/$node->nid/revisions/{$nodes[1]->vid}/delete", array(), t('Delete'));
$this->assertRaw(t('Revision from %revision-date of @type %title has been deleted.', $this->assertRaw(t('Revision from %revision-date of @type %title has been deleted.',
array('%revision-date' => format_date($nodes[1]->revision_timestamp), array('%revision-date' => format_date($nodes[1]->revision_timestamp),
'@type' => 'Basic page', '%title' => $nodes[1]->title)), t('Revision deleted.')); '@type' => 'Basic page', '%title' => $nodes[1]->label())), t('Revision deleted.'));
$this->assertTrue(db_query('SELECT COUNT(vid) FROM {node_revision} WHERE nid = :nid and vid = :vid', array(':nid' => $node->nid, ':vid' => $nodes[1]->vid))->fetchField() == 0, t('Revision not found.')); $this->assertTrue(db_query('SELECT COUNT(vid) FROM {node_revision} WHERE nid = :nid and vid = :vid', array(':nid' => $node->nid, ':vid' => $nodes[1]->vid))->fetchField() == 0, t('Revision not found.'));
// Set the revision timestamp to an older date to make sure that the // Set the revision timestamp to an older date to make sure that the
...@@ -109,7 +109,7 @@ function testRevisions() { ...@@ -109,7 +109,7 @@ function testRevisions() {
$this->drupalPost("node/$node->nid/revisions/{$nodes[2]->vid}/revert", array(), t('Revert')); $this->drupalPost("node/$node->nid/revisions/{$nodes[2]->vid}/revert", array(), t('Revert'));
$this->assertRaw(t('@type %title has been reverted back to the revision from %revision-date.', array( $this->assertRaw(t('@type %title has been reverted back to the revision from %revision-date.', array(
'@type' => 'Basic page', '@type' => 'Basic page',