Skip to content
Snippets Groups Projects
Commit 2132cc3e 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 d1e24519
No related branches found
No related tags found
No related merge requests found
Pipeline #332594 failed
......@@ -111,8 +111,8 @@ class CshsGroupByRootFormatterUnitTest extends UnitTestCase {
$link = $this->createMock(Link::class);
$link->method('toString')->willReturn(static::getGeneratedLink($name));
// Use an anonymous class to handle dynamic properties with the correct method signature.
$term = new class() implements TermInterface {
// Use an anonymous class to handle dynamic properties with the correct method signatures and Traversable interface.
$term = new class() implements TermInterface, \IteratorAggregate {
public $parent;
public $target_id;
public $label;
......@@ -139,6 +139,13 @@ class CshsGroupByRootFormatterUnitTest extends UnitTestCase {
return $this->link;
}
/**
* Implement the getIterator() method for IteratorAggregate.
*/
public function getIterator() {
return new \ArrayIterator($this);
}
};
$term->target_id = $this->getFixedTermId($name);
......
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