function ShortcutTestCase::generateShortcutSet

Creates a generic shortcut set.

6 calls to ShortcutTestCase::generateShortcutSet()
ShortcutSetsTestCase::testShortcutSetAdd in drupal/modules/shortcut/shortcut.test
Tests creating a shortcut set.
ShortcutSetsTestCase::testShortcutSetAssign in drupal/modules/shortcut/shortcut.test
Tests switching another user's shortcut set.
ShortcutSetsTestCase::testShortcutSetDelete in drupal/modules/shortcut/shortcut.test
Tests deleting a shortcut set.
ShortcutSetsTestCase::testShortcutSetRenameAlreadyExists in drupal/modules/shortcut/shortcut.test
Tests renaming a shortcut set to the same name as another set.
ShortcutSetsTestCase::testShortcutSetSwitchOwn in drupal/modules/shortcut/shortcut.test
Tests switching a user's own shortcut set.

... See full list

File

drupal/modules/shortcut/shortcut.test, line 51
Tests for shortcut.module.

Class

ShortcutTestCase
Defines base class for shortcut test cases.

Code

function generateShortcutSet($title = '', $default_links = TRUE) {
  $set = new stdClass();
  $set->title = empty($title) ? $this
    ->randomName(10) : $title;
  if ($default_links) {
    $set->links = array();
    $set->links[] = $this
      ->generateShortcutLink('node/add');
    $set->links[] = $this
      ->generateShortcutLink('admin/content');
  }
  shortcut_set_save($set);
  return $set;
}