function RevisionLinkTest::testRenderNullEntity
Same name and namespace in other branches
- 10 core/modules/node/tests/src/Unit/Plugin/views/field/RevisionLinkTest.php \Drupal\Tests\node\Unit\Plugin\views\field\RevisionLinkTest::testRenderNullEntity()
Test the render method when getEntity returns NULL.
@covers ::render
File
-
core/
modules/ node/ tests/ src/ Unit/ Plugin/ views/ field/ RevisionLinkTest.php, line 43
Class
- RevisionLinkTest
- @coversDefaultClass <a href="/api/drupal/core%21modules%21node%21src%21Plugin%21views%21field%21RevisionLink.php/class/RevisionLink/11.x" title="Field handler to present a link to a node revision." class="local">\Drupal\node\Plugin\views\field\RevisionLink</a> @group node
Namespace
Drupal\Tests\node\Unit\Plugin\views\fieldCode
public function testRenderNullEntity() : void {
$row = new ResultRow();
$field = new RevisionLink([
'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));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.