You are here

public function HtmlTitleFilterTest::providerDecodeToText in HTML Title 8

Data provider for testDecodeToText().

See also

testDecodeToText()

File

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

Class

HtmlTitleFilterTest
@coversDefaultClass \Drupal\html_title\HtmlTitleFilter

Namespace

Drupal\Tests\html_title\Unit

Code

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