function ShortcutLinksTestCase::testShortcutLinkChangePath

Tests that changing the path of a shortcut link works.

File

modules/shortcut/shortcut.test, line 178

Class

ShortcutLinksTestCase
Defines shortcut links test cases.

Code

function testShortcutLinkChangePath() {
    $set = $this->set;
    // Tests changing a shortcut path.
    $new_link_path = 'admin/config';
    $this->drupalPost('admin/config/user-interface/shortcut/link/' . $set->links[0]['mlid'], array(
        'shortcut_link[link_title]' => $set->links[0]['link_title'],
        'shortcut_link[link_path]' => $new_link_path,
    ), t('Save'));
    $saved_set = shortcut_set_load($set->set_name);
    $paths = $this->getShortcutInformation($saved_set, 'link_path');
    $this->assertTrue(in_array($new_link_path, $paths), 'Shortcut path changed: ' . $new_link_path);
    $this->assertLinkByHref($new_link_path, 0, 'Shortcut with new path appears on the page.');
}

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