There currently is no test for the "Add parent hierarchy" (TERM_HIERARCHY) config.
Issue fork easy_breadcrumb-3616162
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
csakiistvan✅ Tested and works — MR !218.
Environment
5bfef4e)Prerequisites
2.xbranch inside a Drupal 11.4.4 site.grep -rn TERM_HIERARCHY web/modules/contrib/easy_breadcrumb/tests/returns no matches.Steps
tests/src/Functional/EasyBreadcrumbTermHierarchyTest.php, a functional test that builds a three-level taxonomy hierarchy (Parent → Child → Grandchild), enables Add parent hierarchy, visits the grandchild term page and asserts the three breadcrumb segments in order.ddev drush crTERM_HIERARCHYcondition insrc/EasyBreadcrumbBuilder.php(line 676) withFALSEso parents are never added, and run the test again.src/EasyBreadcrumbBuilder.phpand run the test a final time.Expected results
2.x.Actual results
Before the fix no test referenced
TERM_HIERARCHY, so the "Add parent hierarchy" setting was completely uncovered. After applying MR !218 the new test ran green (1 test, 4 assertions; only pre-existing unrelated deprecation notices). With the condition forced toFALSEit failed withBehat\Mink\Exception\ElementHtmlException: The string "Parent" was not found in the HTML of the element matching css "#block-breadcrumb li:nth-child(2)", confirming the assertions are meaningful; asserting all three segments by position also pins the parent order rather than just their presence. Reverting the builder restored a green run.phpcs --standard=Drupal,DrupalPracticereports no issues on the test file.Testing produced with the assistance of an LLM.
Comment #7
loopduplicate commentedthanks @csakiistva
Comment #9
csakiistvanWelcome @loopduplicate :)