Mercurial > hg > isophonics-drupal-site
diff core/modules/node/tests/src/Functional/NodeActionsConfigurationTest.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 4c8ae668cc8c |
children |
line wrap: on
line diff
--- a/core/modules/node/tests/src/Functional/NodeActionsConfigurationTest.php Mon Apr 23 09:33:26 2018 +0100 +++ b/core/modules/node/tests/src/Functional/NodeActionsConfigurationTest.php Mon Apr 23 09:46:53 2018 +0100 @@ -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 @@ // 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 @@ $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 @@ $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 @@ $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.'); }