You are here

public function FieldValueTest::testFieldValue in Twig Field Value 8

Same name in this branch
  1. 8 tests/src/Kernel/FieldValueTest.php \Drupal\Tests\twig_field_value\Kernel\FieldValueTest::testFieldValue()
  2. 8 tests/src/Unit/FieldValue/FieldValueTest.php \Drupal\Tests\twig_field_value\Unit\FieldValue\FieldValueTest::testFieldValue()
Same name and namespace in other branches
  1. 2.0.x tests/src/Unit/FieldValue/FieldValueTest.php \Drupal\Tests\twig_field_value\Unit\FieldValue\FieldValueTest::testFieldValue()

Asserts the twig field_value filter.

@dataProvider providerTestFieldValue @covers ::getFieldValue

Parameters

$expected_result:

$render_array:

File

tests/src/Unit/FieldValue/FieldValueTest.php, line 67

Class

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

Namespace

Drupal\Tests\twig_field_value\Unit\FieldValue

Code

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