Skip to content
Snippets Groups Projects
Commit 7f3821b0 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 bcaef31c
No related branches found
No related tags found
No related merge requests found
Pipeline #332619 failed
......@@ -110,7 +110,7 @@ class CshsGroupByRootFormatterUnitTest extends UnitTestCase {
* The stubbed term object.
*/
protected function createMockTerm(int $id, string $label, Link $link, $parent = NULL): TermInterface {
return new class($id, $label, $link, $parent) implements TermInterface {
return new class($id, $label, $link, $parent) implements TermInterface, \IteratorAggregate {
private $id;
private $label;
private $link;
......@@ -148,14 +148,14 @@ class CshsGroupByRootFormatterUnitTest extends UnitTestCase {
}
/**
* Implement only the required methods for your test.
* Implement the getIterator() method for IteratorAggregate.
*/
public function getIterator() {
return new \ArrayIterator([]);
}
/**
* Stub out any additional required methods to satisfy TermInterface.
* Stub out additional methods to satisfy TermInterface requirements.
*/
public function bundle() {}
......@@ -214,6 +214,37 @@ class CshsGroupByRootFormatterUnitTest extends UnitTestCase {
*/
public function labelCallback() {}
/**
*
*/
public function toUrl($rel = 'canonical', array $options = []) {}
/**
*
*/
public function createDuplicate() {}
/**
*
*/
public function getCacheTagsToInvalidate() {
return [];
}
/**
*
*/
public function hasLinkTemplate($key) {
return FALSE;
}
/**
*
*/
public function toLinkTemplate($key, $text = NULL, array $options = []) {
return $this->link;
}
};
}
......@@ -237,7 +268,7 @@ class CshsGroupByRootFormatterUnitTest extends UnitTestCase {
$link = $this->createMock(Link::class);
$link->method('toString')->willReturn(static::getGeneratedLink($name));
// Use the custom stub class.
// Use the updated createMockTerm method.
$term_id = $this->getFixedTermId($name);
$term = $this->createMockTerm($term_id, $name, $link);
......
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