There currently is no test for the "Titles to be replaced while generating segments" (REPLACED_TITLES) config.
Issue fork easy_breadcrumb-3615352
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 REPLACED_TITLES web/modules/contrib/easy_breadcrumb/tests/returns no matches.Steps
tests/src/Functional/EasyBreadcrumbReplacedTitlesTest.php, a functional test that creates a node with the path alias/test, sets the Titles to be replaced while generating segments config toTest::Replaced, and asserts the second breadcrumb item on that page containsReplaced.ddev drush cr$mapValuesto an empty array insrc/EasyBreadcrumbBuilder.php(around line 281) so the replacement map is never built, 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
REPLACED_TITLES, so the "Titles to be replaced while generating segments" setting was completely uncovered. After applying MR !209 the new test ran green (1 test, 6 assertions; only pre-existing unrelated deprecation notices). Emptying the replacement map made it fail withBehat\Mink\Exception\ElementHtmlException: The string "Replaced" was not found in the HTML of the element matching css "#block-breadcrumb li:nth-child(2)"., confirming the assertion is meaningful. Reverting the builder restored a green run.Testing produced with the assistance of an LLM.
Comment #7
loopduplicate commentedThank you @csakiistvan
Comment #9
csakiistvanWelcome loopduplicate :)