function ShortcutSetsTestCase::testShortcutSetSwitchOwn

Tests switching a user's own shortcut set.

File

modules/shortcut/shortcut.test, line 254

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.');
}

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