Skip to content
Snippets Groups Projects
Commit 725b47d7 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 c007a4af
No related branches found
No related tags found
No related merge requests found
Pipeline #332741 failed
......@@ -4,7 +4,7 @@ declare(strict_types=1);
namespace Drupal\Tests\cshs\Unit;
use Drupal\Core\Entity\FieldableEntityInterface;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Field\EntityReferenceFieldItemListInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Link;
......@@ -107,11 +107,11 @@ class CshsGroupByRootFormatterUnitTest extends UnitTestCase {
* @param string|null $parent
* The parent term ID (if any).
*
* @return \Drupal\taxonomy\TermInterface
* @return Drupal\Core\Entity\ContentEntityInterface
* The stubbed term object.
*/
protected function createMockTerm(int $id, string $label, Link $link, $parent = NULL): FieldableEntityInterface {
$term_mock = $this->getMockBuilder(FieldableEntityInterface::class)
protected function createMockTerm(int $id, string $label, Link $link, $parent = NULL): ContentEntityInterface {
$term_mock = $this->getMockBuilder(ContentEntityInterface::class)
->disableOriginalConstructor()
->onlyMethods([
'id',
......@@ -121,6 +121,9 @@ class CshsGroupByRootFormatterUnitTest extends UnitTestCase {
'getFieldDefinition',
'getTranslatableFields',
'toArray',
'set',
'get',
'hasField',
])
->getMock();
......@@ -131,6 +134,9 @@ class CshsGroupByRootFormatterUnitTest extends UnitTestCase {
$term_mock->method('getFieldDefinition')->willReturn(NULL);
$term_mock->method('getTranslatableFields')->willReturn([]);
$term_mock->method('toArray')->willReturn([]);
$term_mock->method('set')->willReturnSelf();
$term_mock->method('get')->willReturn(NULL);
$term_mock->method('hasField')->willReturn(FALSE);
return $term_mock;
}
......
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