You are here

public function ShortcutLinksTest::testShortcutLinkChangeRoute in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/shortcut/src/Tests/ShortcutLinksTest.php \Drupal\shortcut\Tests\ShortcutLinksTest::testShortcutLinkChangeRoute()

Tests that changing the route of a shortcut link works.

File

core/modules/shortcut/src/Tests/ShortcutLinksTest.php, line 236
Contains \Drupal\shortcut\Tests\ShortcutLinksTest.

Class

ShortcutLinksTest
Create, view, edit, delete, and change shortcut links.

Namespace

Drupal\shortcut\Tests

Code

public function testShortcutLinkChangeRoute() {
  $this
    ->drupalLogin($this->rootUser);
  $this
    ->drupalGet('admin/content');
  $this
    ->assertResponse(200);

  // Disable the view.
  entity_load('view', 'content')
    ->disable()
    ->save();

  /** @var \Drupal\Core\Routing\RouteBuilderInterface $router_builder */
  $router_builder = \Drupal::service('router.builder');
  $router_builder
    ->rebuildIfNeeded();
  $this
    ->drupalGet('admin/content');
  $this
    ->assertResponse(200);
}