Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / node / src / Tests / NodeRevisionsTest.php
index 198226616d5ca55064b5345287c96b2228cc9e02..da5b260537794623e43f1e8f7f5e5a557ed5a2be 100644 (file)
@@ -117,7 +117,8 @@ class NodeRevisionsTest extends NodeTestBase {
 
       $node->save();
 
-      $node = Node::load($node->id()); // Make sure we get revision information.
+      // Make sure we get revision information.
+      $node = Node::load($node->id());
       $nodes[] = clone $node;
     }
 
@@ -165,12 +166,13 @@ class NodeRevisionsTest extends NodeTestBase {
     $expected = '<li class="entitynodedelete-form"><a href="' . base_path() . 'node/' . $node->id() . '/delete">Delete</a></li>';
     $this->assertTrue(strstr($json[$ids[0]], $expected), 'The "Delete" contextual link is shown for the default revision.');
 
-
     // Confirm that revisions revert properly.
     $this->drupalPostForm("node/" . $node->id() . "/revisions/" . $nodes[1]->getRevisionid() . "/revert", [], t('Revert'));
-    $this->assertRaw(t('@type %title has been reverted to the revision from %revision-date.',
-                        ['@type' => 'Basic page', '%title' => $nodes[1]->label(),
-                              '%revision-date' => format_date($nodes[1]->getRevisionCreationTime())]), 'Revision reverted.');
+    $this->assertRaw(t('@type %title has been reverted to the revision from %revision-date.', [
+      '@type' => 'Basic page',
+      '%title' => $nodes[1]->label(),
+      '%revision-date' => format_date($nodes[1]->getRevisionCreationTime())
+    ]), 'Revision reverted.');
     $node_storage->resetCache([$node->id()]);
     $reverted_node = $node_storage->load($node->id());
     $this->assertTrue(($nodes[1]->body->value == $reverted_node->body->value), 'Node reverted correctly.');
@@ -188,12 +190,13 @@ class NodeRevisionsTest extends NodeTestBase {
     $this->assertFalse(strstr($json[$ids[0]], '<li class="entitynodeedit-form">'), 'The "Edit" contextual link is not shown for a non-default revision.');
     $this->assertFalse(strstr($json[$ids[0]], '<li class="entitynodedelete-form">'), 'The "Delete" contextual link is not shown for a non-default revision.');
 
-
     // Confirm revisions delete properly.
     $this->drupalPostForm("node/" . $node->id() . "/revisions/" . $nodes[1]->getRevisionId() . "/delete", [], t('Delete'));
-    $this->assertRaw(t('Revision from %revision-date of @type %title has been deleted.',
-                        ['%revision-date' => format_date($nodes[1]->getRevisionCreationTime()),
-                              '@type' => 'Basic page', '%title' => $nodes[1]->label()]), 'Revision deleted.');
+    $this->assertRaw(t('Revision from %revision-date of @type %title has been deleted.', [
+      '%revision-date' => format_date($nodes[1]->getRevisionCreationTime()),
+      '@type' => 'Basic page',
+      '%title' => $nodes[1]->label(),
+    ]), 'Revision deleted.');
     $this->assertTrue(db_query('SELECT COUNT(vid) FROM {node_revision} WHERE nid = :nid and vid = :vid', [':nid' => $node->id(), ':vid' => $nodes[1]->getRevisionId()])->fetchField() == 0, 'Revision not found.');
     $this->assertTrue(db_query('SELECT COUNT(vid) FROM {node_field_revision} WHERE nid = :nid and vid = :vid', [':nid' => $node->id(), ':vid' => $nodes[1]->getRevisionId()])->fetchField() == 0, 'Field revision not found.');