Problem/Motivation

#3221493: Add test coverage for menu order in node type form added a MenuUiNodeTypeTest to ensure that the calling of asort() in menu_ui_form_node_type_form_alter() is tested. Without the asort(), the form would sort the menus by machine name (per how config entities are ordered in a loadMultiple()) rather than by label. Therefore, the test is only effective when testing a dataset that is ordered differently by label than by machine name. The menus included in system.module config only accidentally satisfy that (it's an artifact of the 'account' menu being labeled 'User account menu'). If in the future, system.module config is changed to no longer have a menu with a different label than machine name, then this test will cease to be effective.

Proposed resolution

Change the test to create test menus with the desired properties (different order of labels than machine name) rather than relying on system.module config to have that property.

CommentFileSizeAuthor
menu-sort-test.patch1.65 KBeffulgentsia

Comments

effulgentsia created an issue. See original summary.

andypost’s picture

Status: Needs review » Reviewed & tested by the community

Looks great 👍

  • catch committed e3dd03c on 9.3.x
    Issue #3222465 by effulgentsia: Use test config rather than system...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 9.3.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.