diff options
Diffstat (limited to 'ext/standard/tests/strings/get_html_translation_table_basic3.phpt')
| -rw-r--r-- | ext/standard/tests/strings/get_html_translation_table_basic3.phpt | 43 |
1 files changed, 15 insertions, 28 deletions
diff --git a/ext/standard/tests/strings/get_html_translation_table_basic3.phpt b/ext/standard/tests/strings/get_html_translation_table_basic3.phpt index 58394eb9c..e7c66b5b0 100644 --- a/ext/standard/tests/strings/get_html_translation_table_basic3.phpt +++ b/ext/standard/tests/strings/get_html_translation_table_basic3.phpt @@ -1,42 +1,29 @@ --TEST-- Test get_html_translation_table() function : basic functionality - table as HTML_SPECIALCHARS ---SKIPIF-- -<?php -if( substr(PHP_OS, 0, 3) == "WIN"){ - die('skip Not for Windows'); -} - -if( !setlocale(LC_ALL, "en_US.UTF-8") ) { - die('skip failed to set locale settings to "en-US.UTF-8"'); -} -?> --FILE-- <?php -/* Prototype : array get_html_translation_table ( [int $table [, int $quote_style]] ) +/* Prototype : array get_html_translation_table ( [int $table [, int $quote_style [, string charset_hint]]] ) * Description: Returns the internal translation table used by htmlspecialchars and htmlentities * Source code: ext/standard/html.c */ /* test get_html_translation_table() when $table argument is specified as HTML_SPECIALCHARS */ -//set locale to en_US.UTF-8 -setlocale(LC_ALL, "en_US.UTF-8"); - echo "*** Testing get_html_translation_table() : basic functionality ***\n"; // $table as HTML_SEPCIALCHARS and different quote style echo "-- with table = HTML_SPECIALCHARS & quote_style = ENT_COMPAT --\n"; $table = HTML_SPECIALCHARS; $quote_style = ENT_COMPAT; -var_dump( get_html_translation_table($table, $quote_style) ); +var_dump( get_html_translation_table($table, $quote_style, "UTF-8") ); -echo "-- with table = HTML_SPECIALCHARS & quote_style = ENT_QUOTE --\n"; +echo "-- with table = HTML_SPECIALCHARS & quote_style = ENT_QUOTES --\n"; $quote_style = ENT_QUOTES; -var_dump( get_html_translation_table($table, $quote_style) ); +var_dump( get_html_translation_table($table, $quote_style, "UTF-8") ); -echo "-- with table = HTML_SPECIALCHARS & quote_style = ENT_NOQUOTE --\n"; +echo "-- with table = HTML_SPECIALCHARS & quote_style = ENT_NOQUOTES --\n"; $quote_style = ENT_NOQUOTES; -var_dump( get_html_translation_table($table, $quote_style) ); +var_dump( get_html_translation_table($table, $quote_style, "UTF-8") ); echo "Done\n"; ?> @@ -44,35 +31,35 @@ echo "Done\n"; *** Testing get_html_translation_table() : basic functionality *** -- with table = HTML_SPECIALCHARS & quote_style = ENT_COMPAT -- array(4) { + ["&"]=> + string(5) "&" ["""]=> string(6) """ ["<"]=> string(4) "<" [">"]=> string(4) ">" - ["&"]=> - string(5) "&" } --- with table = HTML_SPECIALCHARS & quote_style = ENT_QUOTE -- +-- with table = HTML_SPECIALCHARS & quote_style = ENT_QUOTES -- array(5) { + ["&"]=> + string(5) "&" ["""]=> string(6) """ ["'"]=> - string(5) "'" + string(6) "'" ["<"]=> string(4) "<" [">"]=> string(4) ">" - ["&"]=> - string(5) "&" } --- with table = HTML_SPECIALCHARS & quote_style = ENT_NOQUOTE -- +-- with table = HTML_SPECIALCHARS & quote_style = ENT_NOQUOTES -- array(3) { + ["&"]=> + string(5) "&" ["<"]=> string(4) "<" [">"]=> string(4) ">" - ["&"]=> - string(5) "&" } Done |
