There currently is no test for the "Alternative title field name for breadcrumb" (ALTERNATIVE_TITLE_FIELD) config.
Issue fork easy_breadcrumb-3614877
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
string) field namedfield_breadcrumb_titleon a content type, and a published node of that type with an URL alias and the field populated./admin/config/user-interface/easy-breadcrumbwith Include the current page title in the breadcrumb enabled (default).Steps
tests/src/Functional/EasyBreadcrumbAlternateTitleFieldTest.php, a functional test that populates an alternative title field, sets thealternative_title_fieldsetting, and asserts the breadcrumb's last segment before and after clearing that setting.field_breadcrumb_titleat/admin/config/user-interface/easy-breadcrumb, save, then visit the node's alias and read the last breadcrumb segment.src/TitleResolver.php::getTitle(), re-run the test, then revert the change.Expected results
DrupalandDrupalPractice.Actual results
Before the MR,
ALTERNATIVE_TITLE_FIELDhad no coverage for a populated value — the only other reference in the test suite sets it to an empty string intests/src/Kernel/EasyBreadcrumbBuilderTest.php. Manual verification in the browser matched the assertions: withfield_breadcrumb_titleconfigured the breadcrumb read Home > Test Breadcrumb Alternate Title Field, and after clearing the setting it read Home > Test Page. With the MR applied,EasyBreadcrumbAlternateTitleFieldTestpassed (1 test, 7 assertions) and the full functional plus kernel suites passed (15 tests, 139 assertions); the reported deprecations originate from unrelated contrib modules installed in the test site, not from this module.phpcsreported no violations on the new file. Short-circuiting the alternative title field branch inTitleResolver::getTitle()made the new test fail as expected, confirming it genuinely covers the configuration.Testing produced with the assistance of an LLM.
Comment #6
csakiistvanComment #8
loopduplicate commentedThanks @csakiistvan
Comment #10
csakiistvanWelcome @loopduplicate :)