There currently is no test for the "Limit breadcrumb trail segments" (LIMIT_SEGMENT_DISPLAY) config.
Issue fork easy_breadcrumb-3615350
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 LIMIT_SEGMENT_DISPLAY web/modules/contrib/easy_breadcrumb/tests/returns no matches.Steps
tests/src/Functional/EasyBreadcrumbLimitSegmentDisplayTest.php, a functional test that creates a node with the path alias/testand asserts the breadcrumb shows the page title as second segment with Limit breadcrumb trail segments disabled, and that the segment disappears once the setting is enabled.ddev drush crsrc/EasyBreadcrumbBuilder.php(around line 729) so the limit is never applied, and run the test again.EasyBreadcrumbBuilder.phpand run the test a final time.Expected results
2.x.Actual results
Before the fix no test referenced
LIMIT_SEGMENT_DISPLAY, so the "Limit breadcrumb trail segments" setting was completely uncovered. After applying MR !208 the new test ran green (1 test, 7 assertions; only pre-existing unrelated deprecation notices). Disabling the trimming branch made it fail withBehat\Mink\Exception\ExpectationException: An element matching css "#block-breadcrumb li:nth-child(2)" appears on this page, but it should not., confirming the assertions are meaningful. Reverting the builder restored a green run.Testing produced with the assistance of an LLM.
Comment #7
loopduplicate commentedThanks @csakiistvan
Comment #9
csakiistvanWelcome loopduplicate :)