You are here

public function PlaceholderResolverTest::testIntegerPlaceholder in Typed Data API enhancements 8

@covers ::replacePlaceHolders

File

tests/src/Kernel/PlaceholderResolverTest.php, line 332

Class

PlaceholderResolverTest
Tests the placeholder resolver.

Namespace

Drupal\Tests\typed_data\Kernel

Code

public function testIntegerPlaceholder() {
  $this->node->field_integer->value = 3;
  $text = 'test {{node.field_integer.0.value}}';
  $result = $this->placeholderResolver
    ->replacePlaceHolders($text, [
    'node' => $this->node
      ->getTypedData(),
  ]);
  $this
    ->assertEquals('test 3', $result);
}