Commit 04c9a71d authored by webchick's avatar webchick

Issue #2186115 by chakrapani, longwave, jhodgdon, benjy, chrischinchilla,...

Issue #2186115 by chakrapani, longwave, jhodgdon, benjy, chrischinchilla, swentel: Shortcuts are added with no link title (hence unusable).
parent 0a423910
......@@ -68,18 +68,33 @@ public function testShortcutLinkAdd() {
}
/**
* Tests that the "add to shortcut" link changes to "remove shortcut".
* Tests that the "add to shortcut" and "remove from shortcut" links work.
*/
public function testShortcutQuickLink() {
theme_enable(array('seven'));
\Drupal::config('system.theme')->set('admin', 'seven')->save();
$this->container->get('config.factory')->get('node.settings')->set('use_admin_theme', '1')->save();
$shortcuts = $this->set->getShortcuts();
$shortcut = reset($shortcuts);
$this->drupalLogin($this->root_user);
$this->drupalGet('admin/config/system/cron');
// Test the "Add to shortcuts" link.
$this->clickLink('Add to Default shortcuts');
$this->assertText('Added a shortcut for Cron.');
$this->assertLink('Cron', 0, 'Shortcut link found on page');
$this->drupalGet('admin/structure');
$this->assertLink('Cron', 0, 'Shortcut link found on different page');
// Test the "Remove from shortcuts" link.
$this->clickLink('Cron');
$this->clickLink('Remove from Default shortcuts');
$this->drupalPostForm(NULL, array(), 'Delete');
$this->assertText('The shortcut Cron has been deleted.');
$this->assertNoLink('Cron', 'Shortcut link removed from page');
$this->drupalGet($shortcut->path->value);
$this->assertRaw(t('Remove from %title shortcuts', array('%title' => $this->set->label())), '"Add to shortcuts" link properly switched to "Remove from shortcuts".');
$this->drupalGet('admin/structure');
$this->assertNoLink('Cron', 'Shortcut link removed from different page');
}
/**
......
......@@ -408,7 +408,7 @@ function shortcut_preprocess_page(&$variables) {
$query = array(
'link' => $link,
'name' => drupal_get_title(),
'name' => $variables['title'],
);
$query += drupal_get_destination();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment