diff --git a/core/modules/field_ui/tests/src/Functional/FieldUIRouteTest.php b/core/modules/field_ui/tests/src/Functional/FieldUIRouteTest.php index 3bbd99518ad6078c4d88e91fdfc6e24afc478fff..1e4f48990bc820e79d72dc974d4a1687f6687634 100644 --- a/core/modules/field_ui/tests/src/Functional/FieldUIRouteTest.php +++ b/core/modules/field_ui/tests/src/Functional/FieldUIRouteTest.php @@ -40,6 +40,11 @@ protected function setUp(): void { * Ensures that entity types with bundles do not break following entity types. */ public function testFieldUIRoutes(): void { + $route = \Drupal::service('router.route_provider')->getRouteByName('entity.entity_test.field_ui_fields'); + $is_admin = \Drupal::service('router.admin_context')->isAdminRoute($route); + // Asserts that admin routes are correctly marked as such. + $this->assertTrue($is_admin, 'Admin route correctly marked for "Manage fields" page.'); + $this->drupalLogin($this->drupalCreateUser([ 'administer account settings', 'administer entity_test_no_id fields', @@ -126,13 +131,4 @@ public function assertLocalTasks(): void { $this->assertSession()->linkExists('Manage form display'); } - /** - * Asserts that admin routes are correctly marked as such. - */ - public function testAdminRoute(): void { - $route = \Drupal::service('router.route_provider')->getRouteByName('entity.entity_test.field_ui_fields'); - $is_admin = \Drupal::service('router.admin_context')->isAdminRoute($route); - $this->assertTrue($is_admin, 'Admin route correctly marked for "Manage fields" page.'); - } - }