function HtmlTest::providerDecodeEntities

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

Data provider for testDecodeEntities().

See also

testDecodeEntities()

File

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

Class

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

Namespace

Drupal\Tests\Component\Utility

Code

public function providerDecodeEntities() {
    return [
        [
            'Drupal',
            'Drupal',
        ],
        [
            '<script>',
            '<script>',
        ],
        [
            '&lt;script&gt;',
            '<script>',
        ],
        [
            '&#60;script&#62;',
            '<script>',
        ],
        [
            '&amp;lt;script&amp;gt;',
            '&lt;script&gt;',
        ],
        [
            '"',
            '"',
        ],
        [
            '&#34;',
            '"',
        ],
        [
            '&amp;#34;',
            '&#34;',
        ],
        [
            '&quot;',
            '"',
        ],
        [
            '&amp;quot;',
            '&quot;',
        ],
        [
            "'",
            "'",
        ],
        [
            '&#39;',
            "'",
        ],
        [
            '&amp;#39;',
            '&#39;',
        ],
        [
            '©',
            '©',
        ],
        [
            '&copy;',
            '©',
        ],
        [
            '&#169;',
            '©',
        ],
        [
            '→',
            '→',
        ],
        [
            '&#8594;',
            '→',
        ],
        [
            '➼',
            '➼',
        ],
        [
            '&#10172;',
            '➼',
        ],
        [
            '&euro;',
            '€',
        ],
    ];
}

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