Annotation of embedaddon/php/ext/standard/tests/strings/get_html_translation_table_basic9.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test get_html_translation_table() function : basic functionality - HTML5 /sjis
3: --FILE--
4: <?php
5: echo "*** Testing get_html_translation_table() : basic functionality/HTML5/SJIS ***\n";
6: echo "*** Only basic entities supported! ***\n";
7:
8: echo "-- with table = HTML_ENTITIES, ENT_QUOTES --\n";
9: $table = HTML_ENTITIES;
10: $tt = get_html_translation_table($table, ENT_QUOTES | ENT_HTML5, "SJIS");
11: asort( $tt );
12: var_dump( count($tt) );
13: print_r( $tt );
14:
15: echo "-- with table = HTML_ENTITIES, ENT_COMPAT --\n";
16: $table = HTML_ENTITIES;
17: $tt = get_html_translation_table($table, ENT_COMPAT | ENT_HTML5, "SJIS");
18: var_dump( count($tt) );
19:
20: echo "-- with table = HTML_ENTITIES, ENT_NOQUOTES --\n";
21: $table = HTML_ENTITIES;
22: $tt = get_html_translation_table($table, ENT_NOQUOTES | ENT_HTML5, "SJIS");
23: var_dump( count($tt) );
24:
25: echo "-- with table = HTML_SPECIALCHARS, ENT_COMPAT --\n";
26: $table = HTML_SPECIALCHARS;
27: $tt = get_html_translation_table($table, ENT_COMPAT, "SJIS");
28: asort( $tt );
29: var_dump( count($tt) );
30: print_r( $tt );
31:
32: echo "-- with table = HTML_SPECIALCHARS, ENT_QUOTES --\n";
33: $table = HTML_SPECIALCHARS;
34: $tt = get_html_translation_table($table, ENT_QUOTES | ENT_HTML5, "SJIS");
35: asort( $tt );
36: var_dump( $tt );
37:
38: echo "-- with table = HTML_SPECIALCHARS, ENT_NOQUOTES --\n";
39: $table = HTML_SPECIALCHARS;
40: $tt = get_html_translation_table($table, ENT_NOQUOTES | ENT_HTML5, "SJIS");
41: asort( $tt );
42: var_dump( $tt );
43:
44:
45: echo "Done\n";
46: ?>
47: --EXPECT--
48: *** Testing get_html_translation_table() : basic functionality/HTML5/SJIS ***
49: *** Only basic entities supported! ***
50: -- with table = HTML_ENTITIES, ENT_QUOTES --
51: int(5)
52: Array
53: (
54: [&] => &
55: ['] => '
56: [>] => >
57: [<] => <
58: ["] => "
59: )
60: -- with table = HTML_ENTITIES, ENT_COMPAT --
61: int(4)
62: -- with table = HTML_ENTITIES, ENT_NOQUOTES --
63: int(3)
64: -- with table = HTML_SPECIALCHARS, ENT_COMPAT --
65: int(4)
66: Array
67: (
68: [&] => &
69: [>] => >
70: [<] => <
71: ["] => "
72: )
73: -- with table = HTML_SPECIALCHARS, ENT_QUOTES --
74: array(5) {
75: ["&"]=>
76: string(5) "&"
77: ["'"]=>
78: string(6) "'"
79: [">"]=>
80: string(4) ">"
81: ["<"]=>
82: string(4) "<"
83: ["""]=>
84: string(6) """
85: }
86: -- with table = HTML_SPECIALCHARS, ENT_NOQUOTES --
87: array(3) {
88: ["&"]=>
89: string(5) "&"
90: [">"]=>
91: string(4) ">"
92: ["<"]=>
93: string(4) "<"
94: }
95: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>