There currently is no test for the "Remove repeated identical segments" (REMOVE_REPEATED_SEGMENTS) config.
Issue fork easy_breadcrumb-3614754
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 !197)Prerequisites
Steps
tests/src/Functional/EasyBreadcrumbRemoveRepeatedSegmentsTest.php, which places the breadcrumb block, creates the three aliased nodes, and asserts every breadcrumb segment on the deep path for three configuration states: Remove repeated identical segments off, on, and on together with Remove repeated segments based on text only./admin/config/user-interface/easy-breadcrumbdisable Remove repeated identical segments, enable Include invalid paths as plain-text segments, then visit/test/test/repeated/repeated/repeated/segments/segments/test-pageand observe the breadcrumb.REMOVE_REPEATED_SEGMENTScondition insrc/EasyBreadcrumbBuilder.phpand re-run the test, then restore the file.Expected results
2.xbranch.Actual results
Before the change nothing in
tests/referencedREMOVE_REPEATED_SEGMENTS, so the configuration was completely uncovered. The new test does what it says: on the unmodified2.xbranch it passes with 1 test and 25 assertions, andphpcswith theDrupalandDrupalPracticestandards reports no violations on the new file. In the browser the asserted behaviour matches. On the deep path the breadcrumb renders as Test Page › Test Page › Repeated › Repeated › Repeated › Segments › Segments › Test Page with Remove repeated identical segments disabled, as Test Page › Test Page › Repeated › Segments › Test Page with it enabled (the second segment survives because/test/testis a real path), and as Test Page › Repeated › Segments › Test Page once Remove repeated segments based on text only is also enabled. The test is genuinely sensitive to the configuration: inverting theREMOVE_REPEATED_SEGMENTScondition insrc/EasyBreadcrumbBuilder.php(line 720) makes it fail in the second configuration block (1 failure, 10 assertions), and it passes again once the file is restored.Two minor, non-blocking notes. The test run triggers a core deprecation that points at the new file: functional test classes must declare the
#[RunTestsInSeparateProcesses]attribute since Drupal 11.3, and none of the module's functional tests do — worth adding here, or in a follow-up covering the whole test suite. The remaining deprecations are unrelated to this issue and 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. The manual verification used articles instead of thepagecontent type created by the test, which does not affect the outcome.Testing produced with the assistance of an LLM.
Comment #7
loopduplicate commentedthank you, @csakiistvan :)
Comment #9
csakiistvanWelcome @loopduplicate :)