public function ShortcutLinksTest::testShortcutLinkChangeRoute in Drupal 10
Same name and namespace in other branches
- 8 core/modules/shortcut/tests/src/Functional/ShortcutLinksTest.php \Drupal\Tests\shortcut\Functional\ShortcutLinksTest::testShortcutLinkChangeRoute()
- 9 core/modules/shortcut/tests/src/Functional/ShortcutLinksTest.php \Drupal\Tests\shortcut\Functional\ShortcutLinksTest::testShortcutLinkChangeRoute()
Tests that changing the route of a shortcut link works.
File
- core/
modules/ shortcut/ tests/ src/ Functional/ ShortcutLinksTest.php, line 275
Class
- ShortcutLinksTest
- Create, view, edit, delete, and change shortcut links.
Namespace
Drupal\Tests\shortcut\FunctionalCode
public function testShortcutLinkChangeRoute() {
$this
->drupalLogin($this->rootUser);
$this
->drupalGet('admin/content');
$this
->assertSession()
->statusCodeEquals(200);
// Disable the view.
View::load('content')
->disable()
->save();
/** @var \Drupal\Core\Routing\RouteBuilderInterface $router_builder */
$router_builder = \Drupal::service('router.builder');
$router_builder
->rebuildIfNeeded();
$this
->drupalGet('admin/content');
$this
->assertSession()
->statusCodeEquals(200);
}