Skip to content
Snippets Groups Projects
Commit 7ac1cabc 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 5dd8e9dc
No related branches found
No related tags found
No related merge requests found
Pipeline #332475 failed
......@@ -78,13 +78,23 @@ class CshsGroupByRootFormatterUnitTest extends UnitTestCase {
foreach ($expectations as $expected_terms) {
$group_title = (string) array_shift($expected_terms);
$group = current($elements);
$this->assertSame((string) $group['#title'], $group_title);
// Use array_values to make sure both arrays are numerically indexed.
$this->assertSame(
(string) $group['#title'],
$group_title,
"Group title does not match."
);
$actual_labels = array_map(static fn($term) => (string) $term['label'], $group['#terms']);
$this->assertSame($actual_labels, array_map('\strval', $expected_terms));
$this->assertSame(
array_values($actual_labels),
array_values(array_map('strval', $expected_terms)),
"Expected and actual term labels do not match."
);
next($elements);
}
}
/**
......
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