You are here

function ShortcutTestCase::generateShortcutSet in Drupal 7

Creates a generic shortcut set.

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

... See full list

File

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;
}