You are here

function ShortcutSetsTestCase::testShortcutSetSwitchOwn in Drupal 7

Tests switching a user's own shortcut set.

File

modules/shortcut/shortcut.test, line 254
Tests for shortcut.module.

Class

ShortcutSetsTestCase
Defines shortcut set test cases.

Code

function testShortcutSetSwitchOwn() {
  $new_set = $this
    ->generateShortcutSet($this
    ->randomName(10));

  // Attempt to switch the default shortcut set to the newly created shortcut
  // set.
  $this
    ->drupalPost('user/' . $this->admin_user->uid . '/shortcuts', array(
    'set' => $new_set->set_name,
  ), t('Change set'));
  $this
    ->assertResponse(200);
  $current_set = shortcut_current_displayed_set($this->admin_user);
  $this
    ->assertTrue($new_set->set_name == $current_set->set_name, 'Successfully switched own shortcut set.');
}