Tests that shortcut links can be renamed.
function testShortcutLinkRename() {
$set = $this->set;
// Attempt to rename shortcut link.
$new_link_name = $this
->randomName();
$link = reset($set->links);
$this
->drupalPost('admin/config/user-interface/shortcut/link/' . $link->mlid, array(
'shortcut_link[link_title]' => $new_link_name,
'shortcut_link[link_path]' => $link->link_path,
), t('Save'));
$saved_set = shortcut_set_load($set
->id());
$titles = $this
->getShortcutInformation($saved_set, 'link_title');
$this
->assertTrue(in_array($new_link_name, $titles), 'Shortcut renamed: ' . $new_link_name);
$this
->assertLink($new_link_name, 0, 'Renamed shortcut link appears on the page.');
}