public function AlinkPostRendererTest::testReplace in Alinks 8
@dataProvider replaceProvider
File
- tests/
src/ Kernel/ AlinkPostRendererTest.php, line 22
Class
- AlinkPostRendererTest
- Class AlinkPostRendererTest.
Namespace
Drupal\Tests\alinks\KernelCode
public function testReplace($content, $expected) {
$keywords = [
Keyword::create([
'name' => 'Foobar',
'link' => [
'uri' => 'internal:/example',
],
]),
Keyword::create([
'name' => 'Katze',
'link' => [
'uri' => 'internal:/cat',
],
]),
];
$renderer = new AlinkPostRenderer($content);
$renderer
->setKeywords($keywords);
$this
->assertEquals($expected, $renderer
->replace());
}