You are here

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

@covers ::replacePlaceHolders

File

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

Class

PlaceholderResolverTest
Tests the placeholder resolver.

Namespace

Drupal\Tests\typed_data\Kernel

Code

public function testReplacePlaceholders() {
  $text = 'test {{node.title}} and {{node.title.value}}';
  $result = $this->placeholderResolver
    ->replacePlaceHolders($text, [
    'node' => $this->node
      ->getTypedData(),
  ]);
  $this
    ->assertEquals('test test and test', $result);
}