function ShortcutSetsTest::testShortcutSetDelete

Same name in other branches
  1. 9 core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php \Drupal\Tests\shortcut\Functional\ShortcutSetsTest::testShortcutSetDelete()
  2. 8.9.x core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php \Drupal\Tests\shortcut\Functional\ShortcutSetsTest::testShortcutSetDelete()
  3. 11.x 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 210

Class

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

Namespace

Drupal\Tests\shortcut\Functional

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.