function ShortcutSetsTestCase::testShortcutSetRenameAlreadyExists

Tests renaming a shortcut set to the same name as another set.

File

modules/shortcut/shortcut.test, line 331

Class

ShortcutSetsTestCase
Defines shortcut set test cases.

Code

function testShortcutSetRenameAlreadyExists() {
    $set = $this->generateShortcutSet($this->randomName(10));
    $existing_title = $this->set->title;
    $this->drupalPost('admin/config/user-interface/shortcut/' . $set->set_name . '/edit', array(
        'title' => $existing_title,
    ), t('Save'));
    $this->assertRaw(t('The shortcut set %name already exists. Choose another name.', array(
        '%name' => $existing_title,
    )));
    $set = shortcut_set_load($set->set_name);
    $this->assertNotEqual($set->title, $existing_title, format_string('The shortcut set %title cannot be renamed to %new-title because a shortcut set with that title already exists.', array(
        '%title' => $set->title,
        '%new-title' => $existing_title,
    )));
}

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