From e3dd03cf39646bf9fc7519a85b395a6c511c1ae7 Mon Sep 17 00:00:00 2001 From: catch <catch@35733.no-reply.drupal.org> Date: Thu, 8 Jul 2021 12:17:13 +0100 Subject: [PATCH] Issue #3222465 by effulgentsia: Use test config rather than system config in MenuUiNodeTypeTest --- .../tests/src/Kernel/MenuUiNodeTypeTest.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/core/modules/menu_ui/tests/src/Kernel/MenuUiNodeTypeTest.php b/core/modules/menu_ui/tests/src/Kernel/MenuUiNodeTypeTest.php index 6affe5df44f4..ac2141a5058b 100644 --- a/core/modules/menu_ui/tests/src/Kernel/MenuUiNodeTypeTest.php +++ b/core/modules/menu_ui/tests/src/Kernel/MenuUiNodeTypeTest.php @@ -4,6 +4,7 @@ use Drupal\KernelTests\KernelTestBase; use Drupal\node\Entity\NodeType; +use Drupal\system\Entity\Menu; use Drupal\Tests\node\Traits\ContentTypeCreationTrait; /** @@ -36,11 +37,9 @@ class MenuUiNodeTypeTest extends KernelTestBase { private function assertMenuNamesAreSorted(NodeType $node_type): void { // The available menus should be sorted by label, not machine name. $expected_options = [ - 'admin' => 'Administration', - 'footer' => 'Footer', - 'main' => 'Main navigation', - 'tools' => 'Tools', - 'account' => 'User account menu', + 'b' => 'X', + 'c' => 'Y', + 'a' => 'Z', ]; $form = $this->container->get('entity.form_builder') ->getForm($node_type, $node_type->isNew() ? 'add' : 'edit'); @@ -51,7 +50,10 @@ private function assertMenuNamesAreSorted(NodeType $node_type): void { * Tests node type-specific settings for Menu UI. */ public function testContentTypeMenuSettings(): void { - $this->installConfig(['node', 'system']); + $this->installConfig(['node']); + Menu::create(['id' => 'a', 'label' => 'Z'])->save(); + Menu::create(['id' => 'b', 'label' => 'X'])->save(); + Menu::create(['id' => 'c', 'label' => 'Y'])->save(); $this->assertMenuNamesAreSorted(NodeType::create()); $this->assertMenuNamesAreSorted($this->createContentType()); } -- GitLab