You are here

public function ShortcutSetsTest::testShortcutSetDelete in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php \Drupal\Tests\shortcut\Functional\ShortcutSetsTest::testShortcutSetDelete()
  2. 10 core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php \Drupal\Tests\shortcut\Functional\ShortcutSetsTest::testShortcutSetDelete()

Tests deleting a shortcut set.

File

core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php, line 188

Class

ShortcutSetsTest
Create, view, edit, delete, and change shortcut sets.

Namespace

Drupal\Tests\shortcut\Functional

Code

public function testShortcutSetDelete() {
  $new_set = $this
    ->generateShortcutSet($this
    ->randomMachineName());
  $this
    ->drupalPostForm('admin/config/user-interface/shortcut/manage/' . $new_set
    ->id() . '/delete', [], t('Delete'));
  $sets = ShortcutSet::loadMultiple();
  $this
    ->assertFalse(isset($sets[$new_set
    ->id()]), 'Successfully deleted a shortcut set.');
}