From: Shein Alexey Date: Mon, 5 Sep 2011 11:00:14 +0000 (+0000) Subject: Make the test faster, what was done: X-Git-Tag: php-5.4.0beta1~223 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5f5b7175eaeef25e784eccdad477fe0af927e385;p=php Make the test faster, what was done: 1) replaced multiple htmlentities calls with one call to get_html_translation table since they share the same code internally 2) reduced the upper range of the "for" loop to 0x2710 (10000), according to http://www.w3.org/TR/html4/sgml/entities.html it's enough 3) placed additional check to make sure all entities from get_html_translation_table were checked in the test --- diff --git a/ext/standard/tests/strings/htmlentities_html4.phpt b/ext/standard/tests/strings/htmlentities_html4.phpt index d7bff707fd..22b0305ced 100644 --- a/ext/standard/tests/strings/htmlentities_html4.phpt +++ b/ext/standard/tests/strings/htmlentities_html4.phpt @@ -1,9 +1,5 @@ --TEST-- htmlentities() conformance check (HTML 4) ---SKIPIF-- - --FILE-- = 0xd800 && $i < 0xe000) continue; $str = utf32_utf8($i); - $result = htmlentities($str, ENT_QUOTES, 'UTF-8'); - if ($str != $result) { - printf("%s\tU+%05X\n", $result, $i); - } + if (isset($table[$str])) { + printf("%s\tU+%05X\n", $table[$str], $i); + unset($table[$str]); + } } + +if (!empty($table)) { + echo "Not matched entities: "; + var_dump($table); +} + ?> --EXPECT-- " U+00022