From cc1c5e909b6e3f62974aeb38842657ea70acd39d Mon Sep 17 00:00:00 2001 From: nod_ <nod_@598310.no-reply.drupal.org> Date: Sun, 28 Jul 2024 15:32:36 +0200 Subject: [PATCH] Issue #3460654 by pooja_sharma, FeyP, catch: Merge test methods in FieldUIRouteTest for better performance (cherry picked from commit 302ee049e4813dc49db40de9e47d0e123c40b428) --- .../tests/src/Functional/FieldUIRouteTest.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/core/modules/field_ui/tests/src/Functional/FieldUIRouteTest.php b/core/modules/field_ui/tests/src/Functional/FieldUIRouteTest.php index 3bbd99518ad6..1e4f48990bc8 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.'); - } - } -- GitLab