function EntityOperationsUnitTest::testRenderWithoutEntity

Same name in other branches
  1. 9 core/modules/views/tests/src/Unit/Plugin/views/field/EntityOperationsUnitTest.php \Drupal\Tests\views\Unit\Plugin\views\field\EntityOperationsUnitTest::testRenderWithoutEntity()
  2. 10 core/modules/views/tests/src/Unit/Plugin/views/field/EntityOperationsUnitTest.php \Drupal\Tests\views\Unit\Plugin\views\field\EntityOperationsUnitTest::testRenderWithoutEntity()

@covers ::render

File

core/modules/views/tests/src/Unit/Plugin/views/field/EntityOperationsUnitTest.php, line 193

Class

EntityOperationsUnitTest
@coversDefaultClass \Drupal\views\Plugin\views\field\EntityOperations @group Views

Namespace

Drupal\Tests\views\Unit\Plugin\views\field

Code

public function testRenderWithoutEntity() : void {
    $this->setUpMockLoggerWithMissingEntity();
    $entity = NULL;
    $result = new ResultRow();
    $result->_entity = $entity;
    $expected_build = '';
    $build = $this->plugin
        ->render($result);
    $this->assertSame($expected_build, $build);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.