function HtmlTest::providerEscape

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Component/Utility/HtmlTest.php \Drupal\Tests\Component\Utility\HtmlTest::providerEscape()
  2. 8.9.x core/tests/Drupal/Tests/Component/Utility/HtmlTest.php \Drupal\Tests\Component\Utility\HtmlTest::providerEscape()
  3. 10 core/tests/Drupal/Tests/Component/Utility/HtmlTest.php \Drupal\Tests\Component\Utility\HtmlTest::providerEscape()

Data provider for testEscape().

See also

testEscape()

File

core/tests/Drupal/Tests/Component/Utility/HtmlTest.php, line 290

Class

HtmlTest
Tests <a href="/api/drupal/core%21lib%21Drupal%21Component%21Utility%21Html.php/class/Html/11.x" title="Provides DOMDocument helpers for parsing and serializing HTML strings." class="local">\Drupal\Component\Utility\Html</a>.

Namespace

Drupal\Tests\Component\Utility

Code

public static function providerEscape() {
    return [
        [
            'Drupal',
            'Drupal',
        ],
        [
            '&lt;script&gt;',
            '<script>',
        ],
        [
            '&amp;lt;script&amp;gt;',
            '&lt;script&gt;',
        ],
        [
            '&amp;#34;',
            '&#34;',
        ],
        [
            '&quot;',
            '"',
        ],
        [
            '&amp;quot;',
            '&quot;',
        ],
        [
            '&#039;',
            "'",
        ],
        [
            '&amp;#039;',
            '&#039;',
        ],
        [
            '©',
            '©',
        ],
        [
            '→',
            '→',
        ],
        [
            '➼',
            '➼',
        ],
        [
            '€',
            '€',
        ],
        // cspell:disable-next-line
[
            'Drup�al',
            "Drup\x80al",
        ],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.