Annotation of embedaddon/php/ext/standard/tests/strings/get_html_translation_table_basic6.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test get_html_translation_table() function : basic functionality - HTML 5/Windows-1251
3: --FILE--
4: <?php
5:
6: function so($a,$b) { return ord($a) - ord($b); }
7:
8: echo "*** Testing get_html_translation_table() : basic functionality - HTML 5/Windows-1251 ***\n";
9:
10: echo "-- with table = HTML_ENTITIES, ENT_COMPAT --\n";
11: $table = HTML_ENTITIES;
12: $tt = get_html_translation_table($table, ENT_COMPAT | ENT_HTML5, "Windows-1251");
13: uksort( $tt, 'so' );
14: var_dump( count($tt) );
15: print_r( $tt );
16:
17: echo "-- with table = HTML_ENTITIES, ENT_QUOTES --\n";
18: $table = HTML_ENTITIES;
19: $tt = get_html_translation_table($table, ENT_QUOTES | ENT_HTML5, "Windows-1251");
20: var_dump( count($tt) );
21:
22: echo "-- with table = HTML_ENTITIES, ENT_NOQUOTES --\n";
23: $table = HTML_ENTITIES;
24: $tt = get_html_translation_table($table, ENT_NOQUOTES | ENT_HTML5, "Windows-1251");
25: var_dump( count($tt) );
26:
27: echo "-- with table = HTML_SPECIALCHARS, ENT_COMPAT --\n";
28: $table = HTML_SPECIALCHARS;
29: $tt = get_html_translation_table($table, ENT_COMPAT, "Windows-1251");
30: uksort( $tt, 'so' );
31: var_dump( count($tt) );
32: print_r( $tt );
33:
34: echo "-- with table = HTML_SPECIALCHARS, ENT_QUOTES --\n";
35: $table = HTML_SPECIALCHARS;
36: $tt = get_html_translation_table($table, ENT_QUOTES | ENT_HTML5, "Windows-1251");
37: uksort( $tt, 'so' );
38: var_dump( $tt );
39:
40: echo "-- with table = HTML_SPECIALCHARS, ENT_NOQUOTES --\n";
41: $table = HTML_SPECIALCHARS;
42: $tt = get_html_translation_table($table, ENT_NOQUOTES | ENT_HTML5, "Windows-1251");
43: uasort( $tt, 'so' );
44: var_dump( $tt );
45:
46:
47: echo "Done\n";
48: ?>
49: --EXPECT--
50: *** Testing get_html_translation_table() : basic functionality - HTML 5/Windows-1251 ***
51: -- with table = HTML_ENTITIES, ENT_COMPAT --
52: int(157)
53: Array
54: (
55: [ ] => 	
56: [
57: ] => 

58: [!] => !
59: ["] => "
60: [#] => #
61: [$] => $
62: [%] => %
63: [&] => &
64: [(] => (
65: [)] => )
66: [*] => *
67: [+] => +
68: [,] => ,
69: [.] => .
70: [/] => /
71: [:] => :
72: [;] => ;
73: [<] => <
74: [=] => =
75: [>] => >
76: [?] => ?
77: [@] => @
78: [[] => [
79: [\] => \
80: []] => ]
81: [^] => ^
82: [_] => _
83: [`] => `
84: [fj] => &fjlig
85: [{] => {
86: [|] => |
87: [}] => }
88: [] => Ђ
89: [] => Ѓ
90: [] => ‚
91: [] => ѓ
92: [] => „
93: [] => …
94: [] => †
95: [] => ‡
96: [] => €
97: [] => ‰
98: [] => Љ
99: [] => ‹
100: [] => Њ
101: [] => Ќ
102: [] => Ћ
103: [] => Џ
104: [] => ђ
105: [] => ‘
106: [] => ’
107: [] => “
108: [] => ”
109: [] => •
110: [] => –
111: [] => —
112: [] => ™
113: [] => љ
114: [] => ›
115: [] => њ
116: [] => ќ
117: [] => ћ
118: [] => џ
119: [] =>
120: [] => Ў
121: [] => ў
122: [] => Ј
123: [] => ¤
124: [] => ¦
125: [] => §
126: [] => Ё
127: [] => ©
128: [] => Є
129: [] => «
130: [] => ¬
131: [] => ­
132: [] => ®
133: [] => Ї
134: [] => °
135: [] => ±
136: [] => І
137: [] => і
138: [] => µ
139: [] => ¶
140: [] => ·
141: [] => ё
142: [] => №
143: [] => є
144: [] => »
145: [] => ј
146: [] => Ѕ
147: [] => ѕ
148: [] => ї
149: [] => А
150: [] => Б
151: [] => В
152: [] => Г
153: [] => Д
154: [] => Е
155: [] => Ж
156: [] => З
157: [] => И
158: [] => Й
159: [] => К
160: [] => Л
161: [] => М
162: [] => Н
163: [] => О
164: [] => П
165: [] => Р
166: [] => С
167: [] => Т
168: [] => У
169: [] => Ф
170: [] => Х
171: [] => Ц
172: [] => Ч
173: [] => Ш
174: [] => Щ
175: [] => Ъ
176: [] => Ы
177: [] => Ь
178: [] => Э
179: [] => Ю
180: [] => Я
181: [] => а
182: [] => б
183: [] => в
184: [] => г
185: [] => д
186: [] => е
187: [] => ж
188: [] => з
189: [] => и
190: [] => й
191: [] => к
192: [] => л
193: [] => м
194: [] => н
195: [] => о
196: [] => п
197: [] => р
198: [] => с
199: [] => т
200: [] => у
201: [] => ф
202: [] => х
203: [] => ц
204: [] => ч
205: [] => ш
206: [] => щ
207: [] => ъ
208: [] => ы
209: [] => ь
210: [] => э
211: [] => ю
212: [] => я
213: )
214: -- with table = HTML_ENTITIES, ENT_QUOTES --
215: int(158)
216: -- with table = HTML_ENTITIES, ENT_NOQUOTES --
217: int(156)
218: -- with table = HTML_SPECIALCHARS, ENT_COMPAT --
219: int(4)
220: Array
221: (
222: ["] => "
223: [&] => &
224: [<] => <
225: [>] => >
226: )
227: -- with table = HTML_SPECIALCHARS, ENT_QUOTES --
228: array(5) {
229: ["""]=>
230: string(6) """
231: ["&"]=>
232: string(5) "&"
233: ["'"]=>
234: string(6) "'"
235: ["<"]=>
236: string(4) "<"
237: [">"]=>
238: string(4) ">"
239: }
240: -- with table = HTML_SPECIALCHARS, ENT_NOQUOTES --
241: array(3) {
242: [">"]=>
243: string(4) ">"
244: ["<"]=>
245: string(4) "<"
246: ["&"]=>
247: string(5) "&"
248: }
249: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>