There currently is no test for the "Include the current page as a segment in the breadcrumb" (INCLUDE_TITLE_SEGMENT) config.
Issue fork easy_breadcrumb-3614749
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
c68c5f0, MR !196)Prerequisites
Steps
tests/src/Functional/EasyBreadcrumbIncludeTitleSegmentTest.php, which places the breadcrumb block, toggles the Include the current page as a segment in the breadcrumb setting on and off, and asserts the second breadcrumb segment on/admin./admin/config/user-interface/easy-breadcrumb, visit/adminand observe the breadcrumb./adminand observe the breadcrumb again.src/EasyBreadcrumbBuilder.php(line 488) never remove the current page, re-run both the new test and the existing kernel test, then restore the file.Expected results
2.xbranch./adminrenders Home › Administration; with it disabled only Home remains.Actual results
The test does what it says. On the unmodified
2.xbranch it passes: 1 test, 6 assertions. The four reported deprecations are unrelated to this issue — they come from other contrib modules installed on the test site (paragraphs_module_implements_alterwithout the#[LegacyModuleImplementsAlter]attribute,Drupal\quick_node_clone\EventSubscriber\AddressEventSubscriber::getSubscribedEvents()) and from core/Twig itself.phpcswith theDrupalandDrupalPracticestandards reports no violations on the new file. In the browser the asserted behaviour matches: with the setting enabled the breadcrumb on/adminrenders as Home › Administration, and with it disabled only the Home segment remains.The coverage gap the issue describes is real, and the new test closes it. Making the condition at
src/EasyBreadcrumbBuilder.phpline 488 never pop the current page leaves the whole existing kernel suite green (12 tests, 112 assertions, OK) — the single existing use ofINCLUDE_TITLE_SEGMENTinEasyBreadcrumbBuilderTest::testMenuTitleIgnoresFragmentLinks()only sets it as a precondition for a different bug and never asserts the setting's effect. The new functional test does fail under the same change (1 test, 6 assertions, 1 failure, on the "segment is not there" assertion) and passes again once the file is restored.Scope note: the test covers the
/adminpath with the default values of the related settings (TITLE_SEGMENT_AS_LINK,TITLE_FROM_PAGE_WHEN_AVAILABLE,ALTERNATIVE_TITLE_FIELD), which is consistent with the scope stated in the issue. Note also that the breadcrumb block is not visible in the Gin admin theme when core's Navigation module is enabled, so the manual verification was done with Claro as the admin theme; this does not affect the test, which runs on Stark.Testing produced with the assistance of an LLM.
Comment #6
csakiistvanComment #8
loopduplicate commentedThanks @csakiistvan
Comment #10
csakiistvanWelcome @loopduplicate :)