There currently is no test for the "Display the front page segment on the front page" (HOME_SEGMENT_KEEP) config.
Issue fork easy_breadcrumb-3615355
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
2.xbranch inside a Drupal 11.4.4 site.grep -rn HOME_SEGMENT_KEEP web/modules/contrib/easy_breadcrumb/tests/returns no matches.Steps
tests/src/Functional/EasyBreadcrumbHomeSegmentKeepTest.php, a functional test that sets a node as the front page, enables the Display the front page segment on the front page setting, and asserts the second breadcrumb item on the front page contains the page title.ddev drush cr$keep_fronttoFALSEinsrc/EasyBreadcrumbBuilder.php(around line 310) and run the test again.EasyBreadcrumbBuilder.phpand run the test a final time.Expected results
2.x.HOME_SEGMENT_KEEPbranch disabled, the test fails — proving it genuinely covers the setting rather than passing vacuously.EasyBreadcrumbInstallUninstallTest) is unaffected.Actual results
Before the fix no test referenced
HOME_SEGMENT_KEEP, so the "Display the front page segment on the front page" setting was completely uncovered. After applying MR !210 the new test ran green (1 test, 3 assertions; only pre-existing unrelated deprecation notices). Forcing$keep_front = FALSEmade it fail withBehat\Mink\Exception\ElementNotFoundException: Element matching css "#block-breadcrumb li:nth-child(2)" not found., confirming the assertion is meaningful. Reverting the builder restored a green run.EasyBreadcrumbInstallUninstallTestalso stayed green (1 test, 11 assertions).Testing produced with the assistance of an LLM.
Comment #7
loopduplicate commentedThanks @csakiistvan
Comment #9
csakiistvanWelcome @loopduplicate :)
Comment #10
greg boggsAll your work on the module has been amazing. There's a few features that I accidentally broke in the module that currently need work. One of the things that is broken is this feature.
With this feature turned off, there should be no breadcrumb on the front page.
With this featured turned on, there should be a Home page breadcrumb with the text "Home" because that's part of the default configuration.
I believe the ideal test for this feature is:
Comment #11
greg boggsHere's the issue the previous maintainer created for the issue. His plan was to reverse the feature, so that it's turned on by default and turning it on hides the homepage crumb on the homepage. I don't have opinions on rewording the feature, but it would be nice to get this working again.
https://www.drupal.org/project/easy_breadcrumb/issues/3460611
Comment #12
loopduplicate commentedWhoops! Thanks for catching this, Greg. I made a follow up: #3616195
Comment #13
loopduplicate commentedClosed that follow up issue I created in favor of using the old one, https://www.drupal.org/project/easy_breadcrumb/issues/3460611