1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/ext/standard/tests/strings/get_html_translation_table_basic7.phpt
Peter Kokot d679f02295 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:33:09 +02:00

343 lines
7.1 KiB
PHP
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
--TEST--
Test get_html_translation_table() function : basic functionality - XHTML 1.0
--FILE--
<?php
echo "*** Testing get_html_translation_table() : basic functionality/XHTML 1.0 ***\n";
echo "-- with table = HTML_ENTITIES, ENT_QUOTES --\n";
$table = HTML_ENTITIES;
/* uses &#039; to share the code path with HTML 4.01 */
$tt = get_html_translation_table($table, ENT_QUOTES | ENT_XHTML, "UTF-8");
asort( $tt );
var_dump( count($tt) );
print_r( $tt );
echo "-- with table = HTML_ENTITIES, ENT_COMPAT --\n";
$table = HTML_ENTITIES;
$tt = get_html_translation_table($table, ENT_COMPAT | ENT_XHTML, "UTF-8");
var_dump( count($tt) );
echo "-- with table = HTML_ENTITIES, ENT_NOQUOTES --\n";
$table = HTML_ENTITIES;
$tt = get_html_translation_table($table, ENT_NOQUOTES | ENT_XHTML, "UTF-8");
var_dump( count($tt) );
echo "-- with table = HTML_SPECIALCHARS, ENT_COMPAT --\n";
$table = HTML_SPECIALCHARS;
$tt = get_html_translation_table($table, ENT_COMPAT, "UTF-8");
asort( $tt );
var_dump( count($tt) );
print_r( $tt );
echo "-- with table = HTML_SPECIALCHARS, ENT_QUOTES --\n";
$table = HTML_SPECIALCHARS;
$tt = get_html_translation_table($table, ENT_QUOTES | ENT_XHTML, "UTF-8");
asort( $tt );
var_dump( $tt );
echo "-- with table = HTML_SPECIALCHARS, ENT_NOQUOTES --\n";
$table = HTML_SPECIALCHARS;
$tt = get_html_translation_table($table, ENT_NOQUOTES | ENT_XHTML, "UTF-8");
asort( $tt );
var_dump( $tt );
echo "Done\n";
?>
--EXPECT--
*** Testing get_html_translation_table() : basic functionality/XHTML 1.0 ***
-- with table = HTML_ENTITIES, ENT_QUOTES --
int(253)
Array
(
['] => &#039;
[Æ] => &AElig;
[Á] => &Aacute;
[Â] => &Acirc;
[À] => &Agrave;
[Α] => &Alpha;
[Å] => &Aring;
[Ã] => &Atilde;
[Ä] => &Auml;
[Β] => &Beta;
[Ç] => &Ccedil;
[Χ] => &Chi;
[‡] => &Dagger;
[Δ] => &Delta;
[Ð] => &ETH;
[É] => &Eacute;
[Ê] => &Ecirc;
[È] => &Egrave;
[Ε] => &Epsilon;
[Η] => &Eta;
[Ë] => &Euml;
[Γ] => &Gamma;
[Í] => &Iacute;
[Î] => &Icirc;
[Ì] => &Igrave;
[Ι] => &Iota;
[Ï] => &Iuml;
[Κ] => &Kappa;
[Λ] => &Lambda;
[Μ] => &Mu;
[Ñ] => &Ntilde;
[Ν] => &Nu;
[Œ] => &OElig;
[Ó] => &Oacute;
[Ô] => &Ocirc;
[Ò] => &Ograve;
[Ω] => &Omega;
[Ο] => &Omicron;
[Ø] => &Oslash;
[Õ] => &Otilde;
[Ö] => &Ouml;
[Φ] => &Phi;
[Π] => &Pi;
[″] => &Prime;
[Ψ] => &Psi;
[Ρ] => &Rho;
[Š] => &Scaron;
[Σ] => &Sigma;
[Þ] => &THORN;
[Τ] => &Tau;
[Θ] => &Theta;
[Ú] => &Uacute;
[Û] => &Ucirc;
[Ù] => &Ugrave;
[Υ] => &Upsilon;
[Ü] => &Uuml;
[Ξ] => &Xi;
[Ý] => &Yacute;
[Ÿ] => &Yuml;
[Ζ] => &Zeta;
[á] => &aacute;
[â] => &acirc;
[´] => &acute;
[æ] => &aelig;
[à] => &agrave;
[ℵ] => &alefsym;
[α] => &alpha;
[&] => &amp;
[∧] => &and;
[∠] => &ang;
[å] => &aring;
[≈] => &asymp;
[ã] => &atilde;
[ä] => &auml;
[„] => &bdquo;
[β] => &beta;
[¦] => &brvbar;
[•] => &bull;
[∩] => &cap;
[ç] => &ccedil;
[¸] => &cedil;
[¢] => &cent;
[χ] => &chi;
[ˆ] => &circ;
[♣] => &clubs;
[≅] => &cong;
[©] => &copy;
[↵] => &crarr;
[] => &cup;
[¤] => &curren;
[⇓] => &dArr;
[†] => &dagger;
[↓] => &darr;
[°] => &deg;
[δ] => &delta;
[♦] => &diams;
[÷] => &divide;
[é] => &eacute;
[ê] => &ecirc;
[è] => &egrave;
[∅] => &empty;
[] => &emsp;
[] => &ensp;
[ε] => &epsilon;
[≡] => &equiv;
[η] => &eta;
[ð] => &eth;
[ë] => &euml;
[€] => &euro;
[∃] => &exist;
[ƒ] => &fnof;
[∀] => &forall;
[½] => &frac12;
[¼] => &frac14;
[¾] => &frac34;
[] => &frasl;
[γ] => &gamma;
[≥] => &ge;
[>] => &gt;
[⇔] => &hArr;
[↔] => &harr;
[♥] => &hearts;
[…] => &hellip;
[í] => &iacute;
[î] => &icirc;
[¡] => &iexcl;
[ì] => &igrave;
[] => &image;
[∞] => &infin;
[∫] => &int;
[ι] => &iota;
[¿] => &iquest;
[∈] => &isin;
[ï] => &iuml;
[κ] => &kappa;
[⇐] => &lArr;
[λ] => &lambda;
[〈] => &lang;
[«] => &laquo;
[←] => &larr;
[⌈] => &lceil;
[“] => &ldquo;
[≤] => &le;
[⌊] => &lfloor;
[] => &lowast;
[◊] => &loz;
[] => &lrm;
[] => &lsaquo;
[] => &lsquo;
[<] => &lt;
[¯] => &macr;
[—] => &mdash;
[µ] => &micro;
[·] => &middot;
[] => &minus;
[μ] => &mu;
[∇] => &nabla;
[ ] => &nbsp;
[] => &ndash;
[≠] => &ne;
[∋] => &ni;
[¬] => &not;
[∉] => &notin;
[⊄] => &nsub;
[ñ] => &ntilde;
[ν] => &nu;
[ó] => &oacute;
[ô] => &ocirc;
[œ] => &oelig;
[ò] => &ograve;
[‾] => &oline;
[ω] => &omega;
[ο] => &omicron;
[⊕] => &oplus;
[] => &or;
[ª] => &ordf;
[º] => &ordm;
[ø] => &oslash;
[õ] => &otilde;
[⊗] => &otimes;
[ö] => &ouml;
[¶] => &para;
[∂] => &part;
[‰] => &permil;
[⊥] => &perp;
[φ] => &phi;
[π] => &pi;
[ϖ] => &piv;
[±] => &plusmn;
[£] => &pound;
[] => &prime;
[∏] => &prod;
[∝] => &prop;
[ψ] => &psi;
["] => &quot;
[⇒] => &rArr;
[√] => &radic;
[〉] => &rang;
[»] => &raquo;
[→] => &rarr;
[⌉] => &rceil;
[”] => &rdquo;
[] => &real;
[®] => &reg;
[⌋] => &rfloor;
[ρ] => &rho;
[] => &rlm;
[] => &rsaquo;
[] => &rsquo;
[] => &sbquo;
[š] => &scaron;
[⋅] => &sdot;
[§] => &sect;
[­] => &shy;
[σ] => &sigma;
[ς] => &sigmaf;
[] => &sim;
[♠] => &spades;
[⊂] => &sub;
[⊆] => &sube;
[∑] => &sum;
[¹] => &sup1;
[²] => &sup2;
[³] => &sup3;
[⊃] => &sup;
[⊇] => &supe;
[ß] => &szlig;
[τ] => &tau;
[∴] => &there4;
[θ] => &theta;
[ϑ] => &thetasym;
[] => &thinsp;
[þ] => &thorn;
[˜] => &tilde;
[×] => &times;
[™] => &trade;
[⇑] => &uArr;
[ú] => &uacute;
[↑] => &uarr;
[û] => &ucirc;
[ù] => &ugrave;
[¨] => &uml;
[ϒ] => &upsih;
[υ] => &upsilon;
[ü] => &uuml;
[℘] => &weierp;
[ξ] => &xi;
[ý] => &yacute;
[¥] => &yen;
[ÿ] => &yuml;
[ζ] => &zeta;
[] => &zwj;
[] => &zwnj;
)
-- with table = HTML_ENTITIES, ENT_COMPAT --
int(252)
-- with table = HTML_ENTITIES, ENT_NOQUOTES --
int(251)
-- with table = HTML_SPECIALCHARS, ENT_COMPAT --
int(4)
Array
(
[&] => &amp;
[>] => &gt;
[<] => &lt;
["] => &quot;
)
-- with table = HTML_SPECIALCHARS, ENT_QUOTES --
array(5) {
["&"]=>
string(5) "&amp;"
["'"]=>
string(6) "&apos;"
[">"]=>
string(4) "&gt;"
["<"]=>
string(4) "&lt;"
["""]=>
string(6) "&quot;"
}
-- with table = HTML_SPECIALCHARS, ENT_NOQUOTES --
array(3) {
["&"]=>
string(5) "&amp;"
[">"]=>
string(4) "&gt;"
["<"]=>
string(4) "&lt;"
}
Done