1--TEST--
2Test get_html_translation_table() function : basic functionality - with default args
3--FILE--
4<?php
5/* Test get_html_translation_table() when table is specified as HTML_ENTITIES */
6
7
8echo "*** Testing get_html_translation_table() : basic functionality ***\n";
9
10echo "-- with table = HTML_ENTITIES --\n";
11$table = HTML_ENTITIES;
12$tt = get_html_translation_table($table, ENT_COMPAT, "UTF-8");
13asort($tt);
14var_dump( $tt );
15
16echo "-- with table = HTML_SPECIALCHARS --\n";
17$table = HTML_SPECIALCHARS;
18$tt = get_html_translation_table($table, ENT_COMPAT, "UTF-8");
19asort($tt);
20var_dump( $tt );
21
22echo "Done\n";
23?>
24--EXPECT--
25*** Testing get_html_translation_table() : basic functionality ***
26-- with table = HTML_ENTITIES --
27array(252) {
28  ["Æ"]=>
29  string(7) "&AElig;"
30  ["Á"]=>
31  string(8) "&Aacute;"
32  ["Â"]=>
33  string(7) "&Acirc;"
34  ["À"]=>
35  string(8) "&Agrave;"
36  ["Α"]=>
37  string(7) "&Alpha;"
38  ["Å"]=>
39  string(7) "&Aring;"
40  ["Ã"]=>
41  string(8) "&Atilde;"
42  ["Ä"]=>
43  string(6) "&Auml;"
44  ["Β"]=>
45  string(6) "&Beta;"
46  ["Ç"]=>
47  string(8) "&Ccedil;"
48  ["Χ"]=>
49  string(5) "&Chi;"
50  ["‡"]=>
51  string(8) "&Dagger;"
52  ["Δ"]=>
53  string(7) "&Delta;"
54  ["Ð"]=>
55  string(5) "&ETH;"
56  ["É"]=>
57  string(8) "&Eacute;"
58  ["Ê"]=>
59  string(7) "&Ecirc;"
60  ["È"]=>
61  string(8) "&Egrave;"
62  ["Ε"]=>
63  string(9) "&Epsilon;"
64  ["Η"]=>
65  string(5) "&Eta;"
66  ["Ë"]=>
67  string(6) "&Euml;"
68  ["Γ"]=>
69  string(7) "&Gamma;"
70  ["Í"]=>
71  string(8) "&Iacute;"
72  ["Î"]=>
73  string(7) "&Icirc;"
74  ["Ì"]=>
75  string(8) "&Igrave;"
76  ["Ι"]=>
77  string(6) "&Iota;"
78  ["Ï"]=>
79  string(6) "&Iuml;"
80  ["Κ"]=>
81  string(7) "&Kappa;"
82  ["Λ"]=>
83  string(8) "&Lambda;"
84  ["Μ"]=>
85  string(4) "&Mu;"
86  ["Ñ"]=>
87  string(8) "&Ntilde;"
88  ["Ν"]=>
89  string(4) "&Nu;"
90  ["Œ"]=>
91  string(7) "&OElig;"
92  ["Ó"]=>
93  string(8) "&Oacute;"
94  ["Ô"]=>
95  string(7) "&Ocirc;"
96  ["Ò"]=>
97  string(8) "&Ograve;"
98  ["Ω"]=>
99  string(7) "&Omega;"
100  ["Ο"]=>
101  string(9) "&Omicron;"
102  ["Ø"]=>
103  string(8) "&Oslash;"
104  ["Õ"]=>
105  string(8) "&Otilde;"
106  ["Ö"]=>
107  string(6) "&Ouml;"
108  ["Φ"]=>
109  string(5) "&Phi;"
110  ["Π"]=>
111  string(4) "&Pi;"
112  ["″"]=>
113  string(7) "&Prime;"
114  ["Ψ"]=>
115  string(5) "&Psi;"
116  ["Ρ"]=>
117  string(5) "&Rho;"
118  ["Š"]=>
119  string(8) "&Scaron;"
120  ["Σ"]=>
121  string(7) "&Sigma;"
122  ["Þ"]=>
123  string(7) "&THORN;"
124  ["Τ"]=>
125  string(5) "&Tau;"
126  ["Θ"]=>
127  string(7) "&Theta;"
128  ["Ú"]=>
129  string(8) "&Uacute;"
130  ["Û"]=>
131  string(7) "&Ucirc;"
132  ["Ù"]=>
133  string(8) "&Ugrave;"
134  ["Υ"]=>
135  string(9) "&Upsilon;"
136  ["Ü"]=>
137  string(6) "&Uuml;"
138  ["Ξ"]=>
139  string(4) "&Xi;"
140  ["Ý"]=>
141  string(8) "&Yacute;"
142  ["Ÿ"]=>
143  string(6) "&Yuml;"
144  ["Ζ"]=>
145  string(6) "&Zeta;"
146  ["á"]=>
147  string(8) "&aacute;"
148  ["â"]=>
149  string(7) "&acirc;"
150  ["´"]=>
151  string(7) "&acute;"
152  ["æ"]=>
153  string(7) "&aelig;"
154  ["à"]=>
155  string(8) "&agrave;"
156  ["ℵ"]=>
157  string(9) "&alefsym;"
158  ["α"]=>
159  string(7) "&alpha;"
160  ["&"]=>
161  string(5) "&amp;"
162  ["∧"]=>
163  string(5) "&and;"
164  ["∠"]=>
165  string(5) "&ang;"
166  ["å"]=>
167  string(7) "&aring;"
168  ["≈"]=>
169  string(7) "&asymp;"
170  ["ã"]=>
171  string(8) "&atilde;"
172  ["ä"]=>
173  string(6) "&auml;"
174  ["„"]=>
175  string(7) "&bdquo;"
176  ["β"]=>
177  string(6) "&beta;"
178  ["¦"]=>
179  string(8) "&brvbar;"
180  ["•"]=>
181  string(6) "&bull;"
182  ["∩"]=>
183  string(5) "&cap;"
184  ["ç"]=>
185  string(8) "&ccedil;"
186  ["¸"]=>
187  string(7) "&cedil;"
188  ["¢"]=>
189  string(6) "&cent;"
190  ["χ"]=>
191  string(5) "&chi;"
192  ["ˆ"]=>
193  string(6) "&circ;"
194  ["♣"]=>
195  string(7) "&clubs;"
196  ["≅"]=>
197  string(6) "&cong;"
198  ["©"]=>
199  string(6) "&copy;"
200  ["↵"]=>
201  string(7) "&crarr;"
202  ["∪"]=>
203  string(5) "&cup;"
204  ["¤"]=>
205  string(8) "&curren;"
206  ["⇓"]=>
207  string(6) "&dArr;"
208  ["†"]=>
209  string(8) "&dagger;"
210  ["↓"]=>
211  string(6) "&darr;"
212  ["°"]=>
213  string(5) "&deg;"
214  ["δ"]=>
215  string(7) "&delta;"
216  ["♦"]=>
217  string(7) "&diams;"
218  ["÷"]=>
219  string(8) "&divide;"
220  ["é"]=>
221  string(8) "&eacute;"
222  ["ê"]=>
223  string(7) "&ecirc;"
224  ["è"]=>
225  string(8) "&egrave;"
226  ["∅"]=>
227  string(7) "&empty;"
228  [" "]=>
229  string(6) "&emsp;"
230  [" "]=>
231  string(6) "&ensp;"
232  ["ε"]=>
233  string(9) "&epsilon;"
234  ["≡"]=>
235  string(7) "&equiv;"
236  ["η"]=>
237  string(5) "&eta;"
238  ["ð"]=>
239  string(5) "&eth;"
240  ["ë"]=>
241  string(6) "&euml;"
242  ["€"]=>
243  string(6) "&euro;"
244  ["∃"]=>
245  string(7) "&exist;"
246  ["ƒ"]=>
247  string(6) "&fnof;"
248  ["∀"]=>
249  string(8) "&forall;"
250  ["½"]=>
251  string(8) "&frac12;"
252  ["¼"]=>
253  string(8) "&frac14;"
254  ["¾"]=>
255  string(8) "&frac34;"
256  ["⁄"]=>
257  string(7) "&frasl;"
258  ["γ"]=>
259  string(7) "&gamma;"
260  ["≥"]=>
261  string(4) "&ge;"
262  [">"]=>
263  string(4) "&gt;"
264  ["⇔"]=>
265  string(6) "&hArr;"
266  ["↔"]=>
267  string(6) "&harr;"
268  ["♥"]=>
269  string(8) "&hearts;"
270  ["…"]=>
271  string(8) "&hellip;"
272  ["í"]=>
273  string(8) "&iacute;"
274  ["î"]=>
275  string(7) "&icirc;"
276  ["¡"]=>
277  string(7) "&iexcl;"
278  ["ì"]=>
279  string(8) "&igrave;"
280  ["ℑ"]=>
281  string(7) "&image;"
282  ["∞"]=>
283  string(7) "&infin;"
284  ["∫"]=>
285  string(5) "&int;"
286  ["ι"]=>
287  string(6) "&iota;"
288  ["¿"]=>
289  string(8) "&iquest;"
290  ["∈"]=>
291  string(6) "&isin;"
292  ["ï"]=>
293  string(6) "&iuml;"
294  ["κ"]=>
295  string(7) "&kappa;"
296  ["⇐"]=>
297  string(6) "&lArr;"
298  ["λ"]=>
299  string(8) "&lambda;"
300  ["〈"]=>
301  string(6) "&lang;"
302  ["«"]=>
303  string(7) "&laquo;"
304  ["←"]=>
305  string(6) "&larr;"
306  ["⌈"]=>
307  string(7) "&lceil;"
308  ["“"]=>
309  string(7) "&ldquo;"
310  ["≤"]=>
311  string(4) "&le;"
312  ["⌊"]=>
313  string(8) "&lfloor;"
314  ["∗"]=>
315  string(8) "&lowast;"
316  ["◊"]=>
317  string(5) "&loz;"
318  ["‎"]=>
319  string(5) "&lrm;"
320  ["‹"]=>
321  string(8) "&lsaquo;"
322  ["‘"]=>
323  string(7) "&lsquo;"
324  ["<"]=>
325  string(4) "&lt;"
326  ["¯"]=>
327  string(6) "&macr;"
328  ["—"]=>
329  string(7) "&mdash;"
330  ["µ"]=>
331  string(7) "&micro;"
332  ["·"]=>
333  string(8) "&middot;"
334  ["−"]=>
335  string(7) "&minus;"
336  ["μ"]=>
337  string(4) "&mu;"
338  ["∇"]=>
339  string(7) "&nabla;"
340  [" "]=>
341  string(6) "&nbsp;"
342  ["–"]=>
343  string(7) "&ndash;"
344  ["≠"]=>
345  string(4) "&ne;"
346  ["∋"]=>
347  string(4) "&ni;"
348  ["¬"]=>
349  string(5) "&not;"
350  ["∉"]=>
351  string(7) "&notin;"
352  ["⊄"]=>
353  string(6) "&nsub;"
354  ["ñ"]=>
355  string(8) "&ntilde;"
356  ["ν"]=>
357  string(4) "&nu;"
358  ["ó"]=>
359  string(8) "&oacute;"
360  ["ô"]=>
361  string(7) "&ocirc;"
362  ["œ"]=>
363  string(7) "&oelig;"
364  ["ò"]=>
365  string(8) "&ograve;"
366  ["‾"]=>
367  string(7) "&oline;"
368  ["ω"]=>
369  string(7) "&omega;"
370  ["ο"]=>
371  string(9) "&omicron;"
372  ["⊕"]=>
373  string(7) "&oplus;"
374  ["∨"]=>
375  string(4) "&or;"
376  ["ª"]=>
377  string(6) "&ordf;"
378  ["º"]=>
379  string(6) "&ordm;"
380  ["ø"]=>
381  string(8) "&oslash;"
382  ["õ"]=>
383  string(8) "&otilde;"
384  ["⊗"]=>
385  string(8) "&otimes;"
386  ["ö"]=>
387  string(6) "&ouml;"
388  ["¶"]=>
389  string(6) "&para;"
390  ["∂"]=>
391  string(6) "&part;"
392  ["‰"]=>
393  string(8) "&permil;"
394  ["⊥"]=>
395  string(6) "&perp;"
396  ["φ"]=>
397  string(5) "&phi;"
398  ["π"]=>
399  string(4) "&pi;"
400  ["ϖ"]=>
401  string(5) "&piv;"
402  ["±"]=>
403  string(8) "&plusmn;"
404  ["£"]=>
405  string(7) "&pound;"
406  ["′"]=>
407  string(7) "&prime;"
408  ["∏"]=>
409  string(6) "&prod;"
410  ["∝"]=>
411  string(6) "&prop;"
412  ["ψ"]=>
413  string(5) "&psi;"
414  ["""]=>
415  string(6) "&quot;"
416  ["⇒"]=>
417  string(6) "&rArr;"
418  ["√"]=>
419  string(7) "&radic;"
420  ["〉"]=>
421  string(6) "&rang;"
422  ["»"]=>
423  string(7) "&raquo;"
424  ["→"]=>
425  string(6) "&rarr;"
426  ["⌉"]=>
427  string(7) "&rceil;"
428  ["”"]=>
429  string(7) "&rdquo;"
430  ["ℜ"]=>
431  string(6) "&real;"
432  ["®"]=>
433  string(5) "&reg;"
434  ["⌋"]=>
435  string(8) "&rfloor;"
436  ["ρ"]=>
437  string(5) "&rho;"
438  ["‏"]=>
439  string(5) "&rlm;"
440  ["›"]=>
441  string(8) "&rsaquo;"
442  ["’"]=>
443  string(7) "&rsquo;"
444  ["‚"]=>
445  string(7) "&sbquo;"
446  ["š"]=>
447  string(8) "&scaron;"
448  ["⋅"]=>
449  string(6) "&sdot;"
450  ["§"]=>
451  string(6) "&sect;"
452  ["­"]=>
453  string(5) "&shy;"
454  ["σ"]=>
455  string(7) "&sigma;"
456  ["ς"]=>
457  string(8) "&sigmaf;"
458  ["∼"]=>
459  string(5) "&sim;"
460  ["♠"]=>
461  string(8) "&spades;"
462  ["⊂"]=>
463  string(5) "&sub;"
464  ["⊆"]=>
465  string(6) "&sube;"
466  ["∑"]=>
467  string(5) "&sum;"
468  ["¹"]=>
469  string(6) "&sup1;"
470  ["²"]=>
471  string(6) "&sup2;"
472  ["³"]=>
473  string(6) "&sup3;"
474  ["⊃"]=>
475  string(5) "&sup;"
476  ["⊇"]=>
477  string(6) "&supe;"
478  ["ß"]=>
479  string(7) "&szlig;"
480  ["τ"]=>
481  string(5) "&tau;"
482  ["∴"]=>
483  string(8) "&there4;"
484  ["θ"]=>
485  string(7) "&theta;"
486  ["ϑ"]=>
487  string(10) "&thetasym;"
488  [" "]=>
489  string(8) "&thinsp;"
490  ["þ"]=>
491  string(7) "&thorn;"
492  ["˜"]=>
493  string(7) "&tilde;"
494  ["×"]=>
495  string(7) "&times;"
496  ["™"]=>
497  string(7) "&trade;"
498  ["⇑"]=>
499  string(6) "&uArr;"
500  ["ú"]=>
501  string(8) "&uacute;"
502  ["↑"]=>
503  string(6) "&uarr;"
504  ["û"]=>
505  string(7) "&ucirc;"
506  ["ù"]=>
507  string(8) "&ugrave;"
508  ["¨"]=>
509  string(5) "&uml;"
510  ["ϒ"]=>
511  string(7) "&upsih;"
512  ["υ"]=>
513  string(9) "&upsilon;"
514  ["ü"]=>
515  string(6) "&uuml;"
516  ["℘"]=>
517  string(8) "&weierp;"
518  ["ξ"]=>
519  string(4) "&xi;"
520  ["ý"]=>
521  string(8) "&yacute;"
522  ["¥"]=>
523  string(5) "&yen;"
524  ["ÿ"]=>
525  string(6) "&yuml;"
526  ["ζ"]=>
527  string(6) "&zeta;"
528  ["‍"]=>
529  string(5) "&zwj;"
530  ["‌"]=>
531  string(6) "&zwnj;"
532}
533-- with table = HTML_SPECIALCHARS --
534array(4) {
535  ["&"]=>
536  string(5) "&amp;"
537  [">"]=>
538  string(4) "&gt;"
539  ["<"]=>
540  string(4) "&lt;"
541  ["""]=>
542  string(6) "&quot;"
543}
544Done
545