Skip to content
Snippets Groups Projects
Commit c7d88ee0 authored by Joseph Olstad's avatar Joseph Olstad
Browse files

Issue #3455186 by cmlara, joseph.olstad - Refactor tests for D11 phpunit 10+...

Issue #3455186 by cmlara, joseph.olstad - Refactor tests for D11 phpunit 10+ compatibility refactoring test.
parent 4c16f73b
No related branches found
No related tags found
No related merge requests found
Pipeline #332443 failed
......@@ -45,15 +45,23 @@ class CshsGroupByRootFormatterUnitTest extends UnitTestCase {
$terms_to_view = array_map(static fn (array $lineage): TermInterface => end($lineage), $terms);
// Debug output for terms_to_view IDs
echo "Terms to view IDs: " . implode(", ", array_map(fn($term) => $term->id(), $terms_to_view)) . "\n";
$mock->expects($this->once())->method('getEntitiesToView')->willReturn($terms_to_view);
$term_storage = $this->createMock(TermStorageInterface::class);
foreach ($terms_to_view as $index => $term) {
$expected_parents = array_reverse($terms[$index]);
// Debug output for expected parent hierarchy
echo "Expected parents for term ID {$term->id()}: " . implode(", ", array_map(fn($term) => $term->id(), $expected_parents)) . "\n";
$term_storage->expects($this->exactly(count($terms_to_view)))
->method('loadAllParents')
->with($term->id())
->willReturn(array_reverse($terms[$index]));
->willReturn($expected_parents);
}
$mock->expects($this->exactly(count($terms_to_view)))->method('getTermStorage')->willReturn($term_storage);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment