function ShortcutTestBase::getShortcutInformation

Extracts information from shortcut set links.

Parameters

object $set: The shortcut set object to extract information from.

string $key: The array key indicating what information to extract from each link:

  • 'link_path': Extract link paths.
  • 'link_title': Extract link titles.
  • 'mlid': Extract the menu link item ID numbers.

Return value

array Array of the requested information from each link.

5 calls to ShortcutTestBase::getShortcutInformation()
ShortcutLinksTest::testShortcutLinkAdd in drupal/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php
Tests that creating a shortcut works properly.
ShortcutLinksTest::testShortcutLinkChangePath in drupal/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php
Tests that changing the path of a shortcut link works.
ShortcutLinksTest::testShortcutLinkDelete in drupal/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php
Tests deleting a shortcut link.
ShortcutLinksTest::testShortcutLinkRename in drupal/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php
Tests that shortcut links can be renamed.
ShortcutSetsTest::testShortcutSetSave in drupal/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutSetsTest.php
Tests that shortcut_set_save() correctly updates existing links.

File

drupal/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutTestBase.php, line 129
Definition of Drupal\shortcut\Tests\ShortcutTestBase.

Class

ShortcutTestBase
Defines base class for shortcut test cases.

Namespace

Drupal\shortcut\Tests

Code

function getShortcutInformation($set, $key) {
  $info = array();
  foreach ($set->links as $link) {
    $info[] = $link[$key];
  }
  return $info;
}