Annotation of embedaddon/php/ext/standard/tests/strings/htmlentities18.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: htmlentities() / htmlspecialchars() "don't double encode" flag support
        !             3: --FILE--
        !             4: <?php
        !             5: $tests = array(
        !             6:        "abc",
        !             7:        "abc&amp;sfdsa",
        !             8:        "test&#043;s &amp; some more &#68;",
        !             9:        "test&#x2b;s &amp; some more &#X44;",
        !            10:        "&; &amp &#a; &9; &#xyz;",
        !            11:        "&kffjadfdhsjfhjasdhffasdfas;",
        !            12:        "&#8787978789",
        !            13:        "&",
        !            14:        "&&amp;&",
        !            15:        "&ab&amp;&",
        !            16: );
        !            17: 
        !            18: foreach ($tests as $test) {
        !            19:        var_dump(htmlentities($test, ENT_QUOTES, NULL, FALSE));
        !            20:        var_dump(htmlspecialchars($test, ENT_QUOTES, NULL, FALSE));
        !            21: }
        !            22: ?>
        !            23: --EXPECT--
        !            24: string(3) "abc"
        !            25: string(3) "abc"
        !            26: string(13) "abc&amp;sfdsa"
        !            27: string(13) "abc&amp;sfdsa"
        !            28: string(33) "test&#043;s &amp; some more &#68;"
        !            29: string(33) "test&#043;s &amp; some more &#68;"
        !            30: string(34) "test&#x2b;s &amp; some more &#X44;"
        !            31: string(34) "test&#x2b;s &amp; some more &#X44;"
        !            32: string(35) "&; &amp;amp &amp;#a; &9; &amp;#xyz;"
        !            33: string(35) "&; &amp;amp &amp;#a; &9; &amp;#xyz;"
        !            34: string(32) "&amp;kffjadfdhsjfhjasdhffasdfas;"
        !            35: string(32) "&amp;kffjadfdhsjfhjasdhffasdfas;"
        !            36: string(16) "&amp;#8787978789"
        !            37: string(16) "&amp;#8787978789"
        !            38: string(5) "&amp;"
        !            39: string(5) "&amp;"
        !            40: string(15) "&amp;&amp;&amp;"
        !            41: string(15) "&amp;&amp;&amp;"
        !            42: string(17) "&amp;ab&amp;&amp;"
        !            43: string(17) "&amp;ab&amp;&amp;"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>