EntityLink example

parent::setUp();
    $this->setUpMockLoggerWithMissingEntity();
  }

  /** * Test the render method when getEntity returns NULL. * * @covers ::render */
  public function testRenderNullEntity(): void {
    $row = new ResultRow();
    $field = new EntityLink(['entity_type' => 'foo', 'entity field' => 'bar'], '', []);
    $view = $this->createMock(ViewExecutable::class);
    $display = $this->createMock(DisplayPluginBase::class);
    $field->init($view$display);
    $this->assertEmpty($field->render($row));
  }

}
Home | Imprint | This part of the site doesn't use cookies.