You are here

public function FieldTargetEntityTest::testTargetEntity in Twig Field Value 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Unit/FieldValue/FieldTargetEntityTest.php \Drupal\Tests\twig_field_value\Unit\FieldValue\FieldTargetEntityTest::testTargetEntity()

Asserts the twig field_target_entity filter.

@dataProvider providerTestTargetEntity @covers ::getTargetEntity

Parameters

$expected_result:

$render_array:

File

tests/src/Unit/FieldValue/FieldTargetEntityTest.php, line 63

Class

FieldTargetEntityTest
@coversDefaultClass \Drupal\twig_field_value\Twig\Extension\FieldValueExtension @group twig_field_value

Namespace

Drupal\Tests\twig_field_value\Unit\FieldValue

Code

public function testTargetEntity($expected_result, $render_array) {
  $result = $this->extension
    ->getTargetEntity($render_array);
  $this
    ->assertSame($expected_result, $result);
}