The configuration option "Applies to administration pages" could use a test.
Issue fork easy_breadcrumb-3614585
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
loopduplicate commentedComment #4
csakiistvanComment #5
csakiistvanEnvironment
Prerequisites
tests/src/Functional/contains onlyEasyBreadcrumbConfigureTest.phpandEasyBreadcrumbInstallUninstallTest.php, and neither asserts anything aboutapplies_admin_routes— the option is untested.Steps
EasyBreadcrumbAdminTestcovering the "Applies to administration pages" option, and renames/commentsEasyBreadcrumbConfigureTest::testAdministration()totestAdministrationAccessAndConfigurationSave()to describe what it actually covers.ddev drush cr/adminas an administrator and note the breadcrumb reads Home / Administration./admin/config/user-interface/easy-breadcrumb, untick Applies to administration pages, save, then reload/adminand note the breadcrumb is only Home.EasyBreadcrumbBuilder::applies()withif (FALSE) {so the option is ignored, re-runEasyBreadcrumbAdminTest, then revert the change.Expected results
/adminwhen the option is on, and disappears when it is off.EasyBreadcrumbAdminTestfails — proving the new test genuinely covers the option rather than passing unconditionally.Actual results
Before the MR the "Applies to administration pages" option had no automated coverage at all, so a regression in
EasyBreadcrumbBuilder::applies()would have gone unnoticed. The manual browser check on 2.x-dev matched the expectation: with the option enabled the breadcrumb on/adminread Home / Administration, and with it disabled only Home remained. With MR !193 applied both functional tests passed (2 tests, 15 assertions; the 4 reported deprecations come from Drupal core and unrelated contrib code in this site, not from the MR). Replacing the admin-route condition withif (FALSE)madeEasyBreadcrumbAdminTest::testAppliesAdminRoutesfail as expected on the "option off" assertion, confirming the test is effective; reverting restored a green run.phpcsagainstDrupal,DrupalPracticereported no violations for either file.Testing produced with the assistance of an LLM.
Comment #7
loopduplicate commentedThanks @csakiistvan :3
Comment #9
csakiistvanWelcome @loopduplicate :)