You are here

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\Kernel

Code

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());
}