function ShortcutSetsTestCase::testShortcutSetSave

Tests that shortcut_set_save() correctly updates existing links.

File

modules/shortcut/shortcut.test, line 304

Class

ShortcutSetsTestCase
Defines shortcut set test cases.

Code

function testShortcutSetSave() {
    $set = $this->set;
    $old_mlids = $this->getShortcutInformation($set, 'mlid');
    $set->links[] = $this->generateShortcutLink('admin', $this->randomName(10));
    shortcut_set_save($set);
    $saved_set = shortcut_set_load($set->set_name);
    $new_mlids = $this->getShortcutInformation($saved_set, 'mlid');
    $this->assertTrue(count(array_intersect($old_mlids, $new_mlids)) == count($old_mlids), 'shortcut_set_save() did not inadvertently change existing mlids.');
}

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