$container->
set('string_translation',
$this->
createMock(TranslationInterface::
class));
\Drupal::
setContainer($container);
} /**
* Test the render method when getEntity returns NULL.
*
* @covers ::render
*/
public function testRenderNullEntity(): void
{ $row =
new ResultRow();
$field =
new LinkReply(['entity_type' => 'foo', 'entity field' => 'bar'
], '',
[],
$this->
createMock(AccessManagerInterface::
class),
$this->
createMock(EntityTypeManagerInterface::
class),
$this->
createMock(EntityRepositoryInterface::
class),
$this->
createMock(LanguageManagerInterface::
class));
$view =
$this->
createMock(ViewExecutable::
class);
$display =
$this->
createMock(DisplayPluginBase::
class);
$field->
init($view,
$display);
$this->
assertEmpty($field->
render($row));
}}