Issue #3549068 by aryan singh, dydave, ressa: Added modules configuration...

https://www.drupal.org/project/admin_toolbar/issues/3549068

Admin Toolbar Search: Added modules configuration links to search suggestions.

Based on MR !182 (closed) and the work of @aryan_singh.
Based on MR !210 (closed) and the work of @MukhtarM.

Summary of the changes to improve test coverage for the module-configuration-links feature:

New fixture test modules (admin_toolbar_search/tests/modules/)

  1. admin_toolbar_search_test – has a configure key with an accessible route gated by its own custom permission (access admin toolbar search test).
  2. admin_toolbar_search_test_restricted – same idea, but installed dynamically mid-test to exercise cache/module-list invalidation on install.
  3. admin_toolbar_search_test_invalid_routeconfigure key points at a route name that is never defined, to test graceful handling of bad/missing routes.

New test class: AdminToolbarSearchModuleConfigLinksTest.php

  • testModuleConfigurationLinkVisibleWithPermission – confirms a module is found by its name (not just path), mirroring the original Glossify issue, and that the link points to the correct configure route.
  • testModuleConfigurationLinkHiddenWithoutPermission – confirms $url->access() is respected: an enabled module with a configure key is not exposed to users lacking access to that route.
  • testInvalidConfigureRouteIsSkippedGracefully – confirms a module whose configure key references a non-existent route doesn't cause an error and is simply skipped (routeExists() coverage).
  • testNewlyInstalledModuleLinkAppearsAfterInstall – installs a module mid-test and asserts its link is absent before and present after, verifying the config:core.extension cache tag invalidation and the ModuleExtensionList::reset() re-scan actually work together, without manual cache clearing.
Edited by David Suissa

Merge request reports

Loading