public function PlaceholderResolverTest::testListPlaceholder in Typed Data API enhancements 8
@covers ::replacePlaceHolders
File
- tests/
src/ Kernel/ PlaceholderResolverTest.php, line 342
Class
- PlaceholderResolverTest
- Tests the placeholder resolver.
Namespace
Drupal\Tests\typed_data\KernelCode
public function testListPlaceholder() {
$this->node->field_integer = [
1,
2,
];
$text = 'test {{node.field_integer}}';
$result = $this->placeholderResolver
->replacePlaceHolders($text, [
'node' => $this->node
->getTypedData(),
]);
$this
->assertEquals('test 1, 2', $result);
}