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

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

Issue #3455186 by cmlara, joseph.olstad - Replace withConsecutive and willReturnOnConsecutiveCalls - adjustments again again again.
parent 7c5da901
No related branches found
No related tags found
No related merge requests found
Pipeline #322654 failed
......@@ -69,7 +69,7 @@ class CshsGroupByRootFormatterUnitTest extends UnitTestCase {
$created[$name] = $this->createMock(TermInterface::class);
$created[$name]
->method('id')
->willReturn(\random_int(1, 10000));
->willReturn($this->getFixedTermId($name));
$created[$name]
->method('label')
->willReturn($name);
......@@ -333,4 +333,28 @@ class CshsGroupByRootFormatterUnitTest extends UnitTestCase {
return (new GeneratedLink())->setGeneratedLink(\sprintf('<a href="/taxonomy/term/%1$s">%s</a>', $name));
}
/**
* Fixed list of term ids instead of a random_int.
*
* @param string $name
* The term name.
*
* @return int
* The Term Id.
*/
protected function getFixedTermId(string $name): int {
$ids = [
'a' => 123,
'b' => 456,
'c' => 789,
'd' => 1011,
'a1' => 2023,
'b1' => 3034,
'c1' => 4056,
'd1' => 5078,
];
return $ids[$name] ?? 0;
}
}
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