diff --git a/core/modules/shortcut/src/Tests/ShortcutLinksTest.php b/core/modules/shortcut/src/Tests/ShortcutLinksTest.php index cf2d732..9ab5aa0 100644 --- a/core/modules/shortcut/src/Tests/ShortcutLinksTest.php +++ b/core/modules/shortcut/src/Tests/ShortcutLinksTest.php @@ -215,4 +215,23 @@ public function testNoShortcutLink() { $this->assertTrue(!empty($result), 'Add to shortcuts link was shown on a page the user does have access to.'); } + /** + * Tests that shortcut links to routes for uninstalled modules are removed. + */ + public function testShortcutUninstalllModule() { + $set = $this->set; + + $label = $this->randomString(); + $form_data = array( + 'title[0][value]' => $label, + 'path' => 'router_test/test2', + ); + $this->drupalPostForm('admin/config/user-interface/shortcut/manage/' . $set->id() . '/add-link', $form_data, t('Save')); + $this->assertResponse(200); + $this->assertLink($label); + + \Drupal::moduleHandler()->uninstall(array('router_test')); + $this->drupalGet('/'); + $this->assertNoLink($label); + } }