Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / action / tests / src / Functional / ConfigurationTest.php
index 472ba17125ce7aba1f5ce22bae4eed5cab27823d..9b9dcf62a07f9a4df76cb3826e71df8ebf8ca787 100644 (file)
@@ -2,7 +2,6 @@
 
 namespace Drupal\Tests\action\Functional;
 
-use Drupal\Component\Utility\Crypt;
 use Drupal\system\Entity\Action;
 use Drupal\Tests\BrowserTestBase;
 
@@ -31,7 +30,7 @@ class ConfigurationTest extends BrowserTestBase {
 
     // Make a POST request to admin/config/system/actions.
     $edit = [];
-    $edit['action'] = Crypt::hashBase64('action_goto_action');
+    $edit['action'] = 'action_goto_action';
     $this->drupalPostForm('admin/config/system/actions', $edit, t('Create'));
     $this->assertResponse(200);
 
@@ -41,17 +40,18 @@ class ConfigurationTest extends BrowserTestBase {
     $edit['label'] = $action_label;
     $edit['id'] = strtolower($action_label);
     $edit['url'] = 'admin';
-    $this->drupalPostForm('admin/config/system/actions/add/' . Crypt::hashBase64('action_goto_action'), $edit, t('Save'));
+    $this->drupalPostForm('admin/config/system/actions/add/action_goto_action', $edit, t('Save'));
     $this->assertResponse(200);
 
+    $action_id = $edit['id'];
+
     // Make sure that the new complex action was saved properly.
     $this->assertText(t('The action has been successfully saved.'), "Make sure we get a confirmation that we've successfully saved the complex action.");
     $this->assertText($action_label, "Make sure the action label appears on the configuration page after we've saved the complex action.");
 
     // 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;
@@ -73,7 +73,7 @@ class ConfigurationTest 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.
@@ -82,7 +82,7 @@ class ConfigurationTest extends BrowserTestBase {
     $this->assertResponse(200);
     $this->assertNoText($new_action_label, "Make sure the action label does not appear on the overview page after we've deleted the action.");
 
-    $action = Action::load($aid);
+    $action = Action::load($action_id);
     $this->assertFalse($action, 'Make sure the action is gone after being deleted.');
   }