Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / content_moderation / tests / src / Functional / ModerationRevisionRevertTest.php
index 7dac15667fbdd5627371837e3fe17c25a26e6bb2..703c10ff7930b9d1ed43a36d7193d2a8ea09e3a5 100644 (file)
@@ -43,7 +43,6 @@ class ModerationRevisionRevertTest extends BrowserTestBase {
       'administer nodes',
       'bypass node access',
       'view all revisions',
-      'view content moderation',
       'use editorial transition create_new_draft',
       'use editorial transition publish',
     ]);
@@ -55,10 +54,16 @@ class ModerationRevisionRevertTest extends BrowserTestBase {
    */
   public function testEditingAfterRevertRevision() {
     // Create a draft.
-    $this->drupalPostForm('node/add/moderated_bundle', ['title[0][value]' => 'First draft node'], t('Save and Create New Draft'));
+    $this->drupalPostForm('node/add/moderated_bundle', [
+      'title[0][value]' => 'First draft node',
+      'moderation_state[0][state]' => 'draft',
+    ], t('Save'));
 
     // Now make it published.
-    $this->drupalPostForm('node/1/edit', ['title[0][value]' => 'Published node'], t('Save and Publish'));
+    $this->drupalPostForm('node/1/edit', [
+      'title[0][value]' => 'Published node',
+      'moderation_state[0][state]' => 'published',
+    ], t('Save'));
 
     // Check the editing form that show the published title.
     $this->drupalGet('node/1/edit');
@@ -76,7 +81,9 @@ class ModerationRevisionRevertTest extends BrowserTestBase {
     $this->assertSession()
       ->pageTextContains('First draft node');
     // Try to save the node.
-    $this->click('.moderation-state-draft > input');
+    $this->drupalPostForm('node/1/edit', [
+      'moderation_state[0][state]' => 'draft',
+    ], t('Save'));
 
     // Check if the submission passed the EntityChangedConstraintValidator.
     $this->assertSession()