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\KernelCode
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);
}