mirror of
https://github.com/php/php-src.git
synced 2024-10-04 08:16:11 +00:00
342 lines
7.1 KiB
Plaintext
342 lines
7.1 KiB
Plaintext
|
--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 ' 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
|
|||
|
(
|
|||
|
['] => '
|
|||
|
[Æ] => Æ
|
|||
|
[Á] => Á
|
|||
|
[Â] => Â
|
|||
|
[À] => À
|
|||
|
[Α] => Α
|
|||
|
[Å] => Å
|
|||
|
[Ã] => Ã
|
|||
|
[Ä] => Ä
|
|||
|
[Β] => Β
|
|||
|
[Ç] => Ç
|
|||
|
[Χ] => Χ
|
|||
|
[‡] => ‡
|
|||
|
[Δ] => Δ
|
|||
|
[Ð] => Ð
|
|||
|
[É] => É
|
|||
|
[Ê] => Ê
|
|||
|
[È] => È
|
|||
|
[Ε] => Ε
|
|||
|
[Η] => Η
|
|||
|
[Ë] => Ë
|
|||
|
[Γ] => Γ
|
|||
|
[Í] => Í
|
|||
|
[Î] => Î
|
|||
|
[Ì] => Ì
|
|||
|
[Ι] => Ι
|
|||
|
[Ï] => Ï
|
|||
|
[Κ] => Κ
|
|||
|
[Λ] => Λ
|
|||
|
[Μ] => Μ
|
|||
|
[Ñ] => Ñ
|
|||
|
[Ν] => Ν
|
|||
|
[Œ] => Œ
|
|||
|
[Ó] => Ó
|
|||
|
[Ô] => Ô
|
|||
|
[Ò] => Ò
|
|||
|
[Ω] => Ω
|
|||
|
[Ο] => Ο
|
|||
|
[Ø] => Ø
|
|||
|
[Õ] => Õ
|
|||
|
[Ö] => Ö
|
|||
|
[Φ] => Φ
|
|||
|
[Π] => Π
|
|||
|
[″] => ″
|
|||
|
[Ψ] => Ψ
|
|||
|
[Ρ] => Ρ
|
|||
|
[Š] => Š
|
|||
|
[Σ] => Σ
|
|||
|
[Þ] => Þ
|
|||
|
[Τ] => Τ
|
|||
|
[Θ] => Θ
|
|||
|
[Ú] => Ú
|
|||
|
[Û] => Û
|
|||
|
[Ù] => Ù
|
|||
|
[Υ] => Υ
|
|||
|
[Ü] => Ü
|
|||
|
[Ξ] => Ξ
|
|||
|
[Ý] => Ý
|
|||
|
[Ÿ] => Ÿ
|
|||
|
[Ζ] => Ζ
|
|||
|
[á] => á
|
|||
|
[â] => â
|
|||
|
[´] => ´
|
|||
|
[æ] => æ
|
|||
|
[à] => à
|
|||
|
[ℵ] => ℵ
|
|||
|
[α] => α
|
|||
|
[&] => &
|
|||
|
[∧] => ∧
|
|||
|
[∠] => ∠
|
|||
|
[å] => å
|
|||
|
[≈] => ≈
|
|||
|
[ã] => ã
|
|||
|
[ä] => ä
|
|||
|
[„] => „
|
|||
|
[β] => β
|
|||
|
[¦] => ¦
|
|||
|
[•] => •
|
|||
|
[∩] => ∩
|
|||
|
[ç] => ç
|
|||
|
[¸] => ¸
|
|||
|
[¢] => ¢
|
|||
|
[χ] => χ
|
|||
|
[ˆ] => ˆ
|
|||
|
[♣] => ♣
|
|||
|
[≅] => ≅
|
|||
|
[©] => ©
|
|||
|
[↵] => ↵
|
|||
|
[∪] => ∪
|
|||
|
[¤] => ¤
|
|||
|
[⇓] => ⇓
|
|||
|
[†] => †
|
|||
|
[↓] => ↓
|
|||
|
[°] => °
|
|||
|
[δ] => δ
|
|||
|
[♦] => ♦
|
|||
|
[÷] => ÷
|
|||
|
[é] => é
|
|||
|
[ê] => ê
|
|||
|
[è] => è
|
|||
|
[∅] => ∅
|
|||
|
[ ] =>  
|
|||
|
[ ] =>  
|
|||
|
[ε] => ε
|
|||
|
[≡] => ≡
|
|||
|
[η] => η
|
|||
|
[ð] => ð
|
|||
|
[ë] => ë
|
|||
|
[€] => €
|
|||
|
[∃] => ∃
|
|||
|
[ƒ] => ƒ
|
|||
|
[∀] => ∀
|
|||
|
[½] => ½
|
|||
|
[¼] => ¼
|
|||
|
[¾] => ¾
|
|||
|
[⁄] => ⁄
|
|||
|
[γ] => γ
|
|||
|
[≥] => ≥
|
|||
|
[>] => >
|
|||
|
[⇔] => ⇔
|
|||
|
[↔] => ↔
|
|||
|
[♥] => ♥
|
|||
|
[…] => …
|
|||
|
[í] => í
|
|||
|
[î] => î
|
|||
|
[¡] => ¡
|
|||
|
[ì] => ì
|
|||
|
[ℑ] => ℑ
|
|||
|
[∞] => ∞
|
|||
|
[∫] => ∫
|
|||
|
[ι] => ι
|
|||
|
[¿] => ¿
|
|||
|
[∈] => ∈
|
|||
|
[ï] => ï
|
|||
|
[κ] => κ
|
|||
|
[⇐] => ⇐
|
|||
|
[λ] => λ
|
|||
|
[〈] => ⟨
|
|||
|
[«] => «
|
|||
|
[←] => ←
|
|||
|
[⌈] => ⌈
|
|||
|
[“] => “
|
|||
|
[≤] => ≤
|
|||
|
[⌊] => ⌊
|
|||
|
[∗] => ∗
|
|||
|
[◊] => ◊
|
|||
|
[] => ‎
|
|||
|
[‹] => ‹
|
|||
|
[‘] => ‘
|
|||
|
[<] => <
|
|||
|
[¯] => ¯
|
|||
|
[—] => —
|
|||
|
[µ] => µ
|
|||
|
[·] => ·
|
|||
|
[−] => −
|
|||
|
[μ] => μ
|
|||
|
[∇] => ∇
|
|||
|
[ ] =>
|
|||
|
[–] => –
|
|||
|
[≠] => ≠
|
|||
|
[∋] => ∋
|
|||
|
[¬] => ¬
|
|||
|
[∉] => ∉
|
|||
|
[⊄] => ⊄
|
|||
|
[ñ] => ñ
|
|||
|
[ν] => ν
|
|||
|
[ó] => ó
|
|||
|
[ô] => ô
|
|||
|
[œ] => œ
|
|||
|
[ò] => ò
|
|||
|
[‾] => ‾
|
|||
|
[ω] => ω
|
|||
|
[ο] => ο
|
|||
|
[⊕] => ⊕
|
|||
|
[∨] => ∨
|
|||
|
[ª] => ª
|
|||
|
[º] => º
|
|||
|
[ø] => ø
|
|||
|
[õ] => õ
|
|||
|
[⊗] => ⊗
|
|||
|
[ö] => ö
|
|||
|
[¶] => ¶
|
|||
|
[∂] => ∂
|
|||
|
[‰] => ‰
|
|||
|
[⊥] => ⊥
|
|||
|
[φ] => φ
|
|||
|
[π] => π
|
|||
|
[ϖ] => ϖ
|
|||
|
[±] => ±
|
|||
|
[£] => £
|
|||
|
[′] => ′
|
|||
|
[∏] => ∏
|
|||
|
[∝] => ∝
|
|||
|
[ψ] => ψ
|
|||
|
["] => "
|
|||
|
[⇒] => ⇒
|
|||
|
[√] => √
|
|||
|
[〉] => ⟩
|
|||
|
[»] => »
|
|||
|
[→] => →
|
|||
|
[⌉] => ⌉
|
|||
|
[”] => ”
|
|||
|
[ℜ] => ℜ
|
|||
|
[®] => ®
|
|||
|
[⌋] => ⌋
|
|||
|
[ρ] => ρ
|
|||
|
[] => ‏
|
|||
|
[›] => ›
|
|||
|
[’] => ’
|
|||
|
[‚] => ‚
|
|||
|
[š] => š
|
|||
|
[⋅] => ⋅
|
|||
|
[§] => §
|
|||
|
[] => ­
|
|||
|
[σ] => σ
|
|||
|
[ς] => ς
|
|||
|
[∼] => ∼
|
|||
|
[♠] => ♠
|
|||
|
[⊂] => ⊂
|
|||
|
[⊆] => ⊆
|
|||
|
[∑] => ∑
|
|||
|
[¹] => ¹
|
|||
|
[²] => ²
|
|||
|
[³] => ³
|
|||
|
[⊃] => ⊃
|
|||
|
[⊇] => ⊇
|
|||
|
[ß] => ß
|
|||
|
[τ] => τ
|
|||
|
[∴] => ∴
|
|||
|
[θ] => θ
|
|||
|
[ϑ] => ϑ
|
|||
|
[ ] =>  
|
|||
|
[þ] => þ
|
|||
|
[˜] => ˜
|
|||
|
[×] => ×
|
|||
|
[™] => ™
|
|||
|
[⇑] => ⇑
|
|||
|
[ú] => ú
|
|||
|
[↑] => ↑
|
|||
|
[û] => û
|
|||
|
[ù] => ù
|
|||
|
[¨] => ¨
|
|||
|
[ϒ] => ϒ
|
|||
|
[υ] => υ
|
|||
|
[ü] => ü
|
|||
|
[℘] => ℘
|
|||
|
[ξ] => ξ
|
|||
|
[ý] => ý
|
|||
|
[¥] => ¥
|
|||
|
[ÿ] => ÿ
|
|||
|
[ζ] => ζ
|
|||
|
[] => ‍
|
|||
|
[] => ‌
|
|||
|
)
|
|||
|
-- 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
|
|||
|
(
|
|||
|
[&] => &
|
|||
|
[>] => >
|
|||
|
[<] => <
|
|||
|
["] => "
|
|||
|
)
|
|||
|
-- with table = HTML_SPECIALCHARS, ENT_QUOTES --
|
|||
|
array(5) {
|
|||
|
["&"]=>
|
|||
|
string(5) "&"
|
|||
|
["'"]=>
|
|||
|
string(6) "'"
|
|||
|
[">"]=>
|
|||
|
string(4) ">"
|
|||
|
["<"]=>
|
|||
|
string(4) "<"
|
|||
|
["""]=>
|
|||
|
string(6) """
|
|||
|
}
|
|||
|
-- with table = HTML_SPECIALCHARS, ENT_NOQUOTES --
|
|||
|
array(3) {
|
|||
|
["&"]=>
|
|||
|
string(5) "&"
|
|||
|
[">"]=>
|
|||
|
string(4) ">"
|
|||
|
["<"]=>
|
|||
|
string(4) "<"
|
|||
|
}
|
|||
|
Done
|