You are here

function ShortcutSetsTestCase::testShortcutSetSave in Drupal 7

Tests that shortcut_set_save() correctly updates existing links.

File

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

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