Issue #2186115 by chakrapani, longwave, jhodgdon, benjy, chrischinchilla, swentel: Shortcuts are added with no link title (hence unusable).

8.0.x
webchick 2014-02-24 12:12:19 -08:00
parent 0a4239109b
commit 04c9a71dbe
2 changed files with 22 additions and 7 deletions

View File

@ -68,18 +68,33 @@ class ShortcutLinksTest extends ShortcutTestBase {
}
/**
* 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');
$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".');
// 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('admin/structure');
$this->assertNoLink('Cron', 'Shortcut link removed from different page');
}
/**

View File

@ -407,8 +407,8 @@ function shortcut_preprocess_page(&$variables) {
}
$query = array(
'link' => $link,
'name' => drupal_get_title(),
'link' => $link,
'name' => $variables['title'],
);
$query += drupal_get_destination();