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

Revert "Issue #3455186 by cmlara, joseph.olstad - Replace withConsecutive and...

Revert "Issue #3455186 by cmlara, joseph.olstad - Replace withConsecutive and willReturnOnConsecutiveCalls."

This reverts commit e539e6e3.
parent e539e6e3
No related branches found
No related tags found
No related merge requests found
......@@ -45,13 +45,22 @@ class CshsGroupByRootFormatterUnitTest extends UnitTestCase {
'getTranslationFromContext',
])
->getMock();
foreach (\array_keys($settings) as $i => $key) {
$mock->expects(static::at($i))
->method('getSetting')
->with($key)
->willReturn($settings[$key]);
}
$mock
->expects(static::exactly(\count($settings)))
->method('getSetting')
->withConsecutive(
...\array_map(
static fn (string $name): array => [$name],
\array_keys($settings),
)
)
->willReturnOnConsecutiveCalls(
...\array_map(
static fn (mixed $value): mixed => $value,
\array_values($settings),
)
);
$terms = \array_map(function (array $lineage): array {
static $created = [];
......@@ -101,13 +110,21 @@ class CshsGroupByRootFormatterUnitTest extends UnitTestCase {
->willReturn($terms_to_view);
$term_storage = $this->createMock(TermStorageInterface::class);
foreach ($terms_to_view as $i => $term) {
$term_storage->expects(static::at($i))
$term_storage
->expects(static::exactly(\count($terms_to_view)))
->method('loadAllParents')
->with($term->id())
->willReturn(\array_reverse($terms[$i]));
}
->withConsecutive(
...\array_map(
static fn (TermInterface $term): array => [$term->id()],
$terms_to_view,
)
)
->willReturnOnConsecutiveCalls(
...\array_map(
static fn (array $lineage): array => \array_reverse($lineage),
\array_values($terms),
)
);
$mock
->expects(static::exactly(\count($terms_to_view)))
......
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