Skip to content
Snippets Groups Projects
Commit c007a4af 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 d8a878f2
No related branches found
No related tags found
No related merge requests found
Pipeline #332740 failed
......@@ -110,31 +110,30 @@ class CshsGroupByRootFormatterUnitTest extends UnitTestCase {
* @return \Drupal\taxonomy\TermInterface
* The stubbed term object.
*/
protected function createMockTerm(int $id, string $label, Link $link, $parent = NULL): FieldableEntityInterface {
$term_mock = $this->getMockBuilder(FieldableEntityInterface::class)
->disableOriginalConstructor()
->onlyMethods([
'id',
'label',
'toLink',
'getFields',
'getFieldDefinition',
'getTranslatableFields',
'toArray',
])
->getMock();
$term_mock->method('id')->willReturn($id);
$term_mock->method('label')->willReturn($label);
$term_mock->method('toLink')->willReturn($link);
$term_mock->method('getFields')->willReturn([]);
$term_mock->method('getFieldDefinition')->willReturn(NULL);
$term_mock->method('getTranslatableFields')->willReturn([]);
$term_mock->method('toArray')->willReturn([]);
return $term_mock;
}
protected function createMockTerm(int $id, string $label, Link $link, $parent = NULL): FieldableEntityInterface {
$term_mock = $this->getMockBuilder(FieldableEntityInterface::class)
->disableOriginalConstructor()
->onlyMethods([
'id',
'label',
'toLink',
'getFields',
'getFieldDefinition',
'getTranslatableFields',
'toArray',
])
->getMock();
$term_mock->method('id')->willReturn($id);
$term_mock->method('label')->willReturn($label);
$term_mock->method('toLink')->willReturn($link);
$term_mock->method('getFields')->willReturn([]);
$term_mock->method('getFieldDefinition')->willReturn(NULL);
$term_mock->method('getTranslatableFields')->willReturn([]);
$term_mock->method('toArray')->willReturn([]);
return $term_mock;
}
/**
* Creates mock terms based on a hierarchy tree and assigns parent IDs.
......
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