Skip to content
Snippets Groups Projects
Commit f85ca4b8 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 fda1ad95
No related branches found
No related tags found
No related merge requests found
Pipeline #332523 failed
......@@ -51,7 +51,7 @@ class CshsGroupByRootFormatterUnitTest extends UnitTestCase {
foreach ($terms_to_view as $index => $term) {
$expected_parents = array_reverse($terms[$index]);
// Mock the `loadAllParents` method.
// Adjust `loadAllParents` method to handle missing relationships.
$term_storage->method('loadAllParents')
->willReturnCallback(function ($term_id) use ($parentRelationships) {
$parents = [];
......@@ -130,11 +130,11 @@ class CshsGroupByRootFormatterUnitTest extends UnitTestCase {
$terms[] = $created[$name];
}
// Establish parent relationships.
// Establish parent relationships in reverse lineage.
$previous = NULL;
foreach ($terms as $term) {
foreach (array_reverse($terms) as $term) {
if ($previous) {
$parentRelationships[$term->id()] = $previous;
$parentRelationships[$previous->id()] = $term;
}
$previous = $term;
}
......
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