Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / node / tests / src / Functional / NodeActionsConfigurationTest.php
index fbfda8f169b78f5c89430863a135cdc894de88c2..d026902f570f021454e2cbe9280435e50a776817 100644 (file)
@@ -2,7 +2,6 @@
 
 namespace Drupal\Tests\node\Functional;
 
-use Drupal\Component\Utility\Crypt;
 use Drupal\Tests\BrowserTestBase;
 use Drupal\system\Entity\Action;
 
@@ -30,7 +29,7 @@ class NodeActionsConfigurationTest extends BrowserTestBase {
 
     // Make a POST request to admin/config/system/actions.
     $edit = [];
-    $edit['action'] = Crypt::hashBase64('node_assign_owner_action');
+    $edit['action'] = 'node_assign_owner_action';
     $this->drupalPostForm('admin/config/system/actions', $edit, t('Create'));
     $this->assertResponse(200);
 
@@ -40,17 +39,17 @@ class NodeActionsConfigurationTest extends BrowserTestBase {
     $edit['label'] = $action_label;
     $edit['id'] = strtolower($action_label);
     $edit['owner_uid'] = $user->id();
-    $this->drupalPostForm('admin/config/system/actions/add/' . Crypt::hashBase64('node_assign_owner_action'), $edit, t('Save'));
+    $this->drupalPostForm('admin/config/system/actions/add/node_assign_owner_action', $edit, t('Save'));
     $this->assertResponse(200);
 
+    $action_id = $edit['id'];
+
     // Make sure that the new action was saved properly.
     $this->assertText(t('The action has been successfully saved.'), 'The node_assign_owner_action action has been successfully saved.');
     $this->assertText($action_label, 'The label of the node_assign_owner_action action appears on the actions administration page after saving.');
 
     // Make another POST request to the action edit page.
     $this->clickLink(t('Configure'));
-    preg_match('|admin/config/system/actions/configure/(.+)|', $this->getUrl(), $matches);
-    $aid = $matches[1];
     $edit = [];
     $new_action_label = $this->randomMachineName();
     $edit['label'] = $new_action_label;
@@ -68,7 +67,7 @@ class NodeActionsConfigurationTest extends BrowserTestBase {
     $this->clickLink(t('Delete'));
     $this->assertResponse(200);
     $edit = [];
-    $this->drupalPostForm("admin/config/system/actions/configure/$aid/delete", $edit, t('Delete'));
+    $this->drupalPostForm(NULL, $edit, t('Delete'));
     $this->assertResponse(200);
 
     // Make sure that the action was actually deleted.
@@ -77,7 +76,7 @@ class NodeActionsConfigurationTest extends BrowserTestBase {
     $this->assertResponse(200);
     $this->assertNoText($new_action_label, 'The label for the node_assign_owner_action action does not appear on the actions administration page after deleting.');
 
-    $action = Action::load($aid);
+    $action = Action::load($action_id);
     $this->assertFalse($action, 'The node_assign_owner_action action is not available after being deleted.');
   }