function ShortcutSetsTest::testShortcutSetSwitchNoSetName

Tests switching a user's shortcut set without providing a new set name.

File

drupal/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutSetsTest.php, line 79
Definition of Drupal\shortcut\Tests\ShortcutSetsTest.

Class

ShortcutSetsTest
Defines shortcut set test cases.

Namespace

Drupal\shortcut\Tests

Code

function testShortcutSetSwitchNoSetName() {
  $edit = array(
    'set' => 'new',
  );
  $this
    ->drupalPost('user/' . $this->admin_user->uid . '/shortcuts', $edit, t('Change set'));
  $this
    ->assertText(t('The new set label is required.'));
  $current_set = shortcut_current_displayed_set($this->admin_user);
  $this
    ->assertEqual($current_set
    ->id(), $this->set
    ->id(), 'Attempting to switch to a new shortcut set without providing a set name does not succeed.');
}