diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeRevisionsTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeRevisionsTest.php index 172ac8a..de3be86 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeRevisionsTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeRevisionsTest.php @@ -36,7 +36,7 @@ class NodeRevisionsTest extends NodeTestBase { $this->drupalLogin($web_user); - // Create an initial node. + // Create initial node. $node = $this->drupalCreateNode(); $settings = get_object_vars($node); $settings['revision'] = 1; @@ -44,7 +44,7 @@ class NodeRevisionsTest extends NodeTestBase { $nodes = array(); $logs = array(); - // Get the original node. + // Get original node. $nodes[] = $node; // Create three revisions. @@ -52,7 +52,7 @@ class NodeRevisionsTest extends NodeTestBase { for ($i = 0; $i < $revision_count; $i++) { $logs[] = $settings['log'] = $this->randomName(32); - // Create revision with a random title and body and update variables. + // Create revision with random title and body and update variables. $this->drupalCreateNode($settings); $node = node_load($node->nid); // Make sure we get revision information. $settings = get_object_vars($node); @@ -65,59 +65,46 @@ class NodeRevisionsTest extends NodeTestBase { } /** - * Tests node revision CRUD operations + * Check node revision related operations. */ function testRevisions() { $nodes = $this->nodes; $logs = $this->logs; - // Get the last node for simple checks. + // Get last node for simple checks. $node = $nodes[3]; // Confirm the correct revision text appears on "view revisions" page. $this->drupalGet("node/$node->nid/revisions/$node->vid/view"); - $this->assertText($node->body[LANGUAGE_NOT_SPECIFIED][0]['value'], 'Correct text displays for version.'); + $this->assertText($node->body[LANGUAGE_NOT_SPECIFIED][0]['value'], t('Correct text displays for version.')); // Confirm the correct log message appears on "revisions overview" page. $this->drupalGet("node/$node->nid/revisions"); foreach ($logs as $log) { - $this->assertText($log, 'Log message found.'); + $this->assertText($log, t('Log message found.')); } // Confirm that this is the current revision. $this->assertTrue($node->isCurrentRevision(), 'Third node revision is the current one.'); - // Confirm that revisions are properly reverted. + // Confirm that revisions revert properly. $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.', - array( - '@type' => 'Basic page', - '%title' => $nodes[1]->title, - '%revision-date' => format_date($nodes[1]->revision_timestamp) - )), - 'Revision reverted.'); + array('@type' => 'Basic page', '%title' => $nodes[1]->title, + '%revision-date' => format_date($nodes[1]->revision_timestamp))), t('Revision reverted.')); $reverted_node = node_load($node->nid); - $this->assertTrue(($nodes[1]->body[LANGUAGE_NOT_SPECIFIED][0]['value'] == $reverted_node->body[LANGUAGE_NOT_SPECIFIED][0]['value']), '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.')); // Confirm that this is not the current version. $node = node_load($node->nid, $node->vid); $this->assertFalse($node->isCurrentRevision(), 'Third node revision is not the current one.'); - // Confirm revisions are properly deleted. + // Confirm revisions delete properly. $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.', - array( - '%revision-date' => format_date($nodes[1]->revision_timestamp), - '@type' => 'Basic page', - '%title' => $nodes[1]->title, - )), - 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.')); + array('%revision-date' => format_date($nodes[1]->revision_timestamp), + '@type' => 'Basic page', '%title' => $nodes[1]->title)), 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.')); // Set the revision timestamp to an older date to make sure that the // confirmation message correctly displays the stored revision date. @@ -241,7 +228,7 @@ class NodeRevisionsAllTestCase extends NodeTestBase { } /** - * Check node revision related operations. + * Checks node revision operations. */ function testRevisions() { $nodes = $this->nodes;