You are here

public function HtmlTitleFilterTest::providerDecodeToMarkup in HTML Title 8

Data provider for testDecodeToText().

See also

testDecodeToMarkup()

File

tests/src/Unit/HtmlTitleFilterTest.php, line 96

Class

HtmlTitleFilterTest
@coversDefaultClass \Drupal\html_title\HtmlTitleFilter

Namespace

Drupal\Tests\html_title\Unit

Code

public function providerDecodeToMarkup() {
  return [
    [
      'test <sup>sup</sup>-tag',
      Markup::create('test <sup>sup</sup>-tag'),
    ],
    [
      'test <p>p</p>-tag',
      Markup::create('test p-tag'),
    ],
    [
      'test &',
      Markup::create('test &amp;'),
    ],
    [
      'test without tags',
      Markup::create('test without tags'),
    ],
    [
      'test <br> br-tag',
      Markup::create('test <br> br-tag'),
    ],
    [
      'test <sub>sub</sub>-tag',
      Markup::create('test <sub>sub</sub>-tag'),
    ],
    [
      'test multiple tags: <sup>sup</sup>-tag, <sub>sub</sub>-tag and <br> br-tag',
      Markup::create('test multiple tags: <sup>sup</sup>-tag, <sub>sub</sub>-tag and <br> br-tag'),
    ],
    [
      'test multiple tags: <sup>sup</sup>-tag, <sub>sub</sub>-tag, <br> br-tag and <p>p</p>-tag',
      Markup::create('test multiple tags: <sup>sup</sup>-tag, <sub>sub</sub>-tag, <br> br-tag and p-tag'),
    ],
    // The html title filter service should also works with renderable arrays.
    [
      [
        '#markup' => '<p>Test renderable <sub>array</sub></p>',
      ],
      Markup::create('Test renderable <sub>array</sub>'),
    ],
  ];
}