~ubuntu-branches/ubuntu/hardy/php5/hardy-updates

« back to all changes in this revision

Viewing changes to ext/standard/tests/strings/htmlentities17.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-10-09 03:14:32 UTC
  • Revision ID: james.westby@ubuntu.com-20051009031432-kspik3lobxstafv9
Tags: upstream-5.0.5
ImportĀ upstreamĀ versionĀ 5.0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
htmlentities() / html_entity_decode() #8592 - #9002 table test
 
3
--FILE--
 
4
<?php
 
5
$tests = array(
 
6
        array(8768, '&wreath;', "e28980"),
 
7
        array(8853, '&oplus;',  "e28a95"),
 
8
        array(8855, '&otimes;', "e28a97"),
 
9
        array(8869, '&perp;',   "e28aa5"),
 
10
        array(8901, '&sdot;',   "e28b85"),
 
11
        array(8968, '&lceil;',  "e28c88"),
 
12
        array(8969, '&rceil;',  "e28c89"),
 
13
        array(8970, '&lfloor;', "e28c8a"),
 
14
        array(8971, '&rfloor;', "e28c8b"),
 
15
        array(9001, '&lang;',   "e28ca9"),
 
16
        array(9002, '&rang;',   "e28caa")
 
17
);
 
18
 
 
19
foreach ($tests as $test) {
 
20
        var_dump(htmlentities(pack('H*', $test[2]), ENT_QUOTES, 'UTF-8'));
 
21
}
 
22
 
 
23
foreach ($tests as $test) {
 
24
        list(,$result) = unpack('H6', html_entity_decode($test[1], ENT_QUOTES, 'UTF-8'));
 
25
        var_dump($result);
 
26
}
 
27
?>
 
28
--EXPECT--
 
29
string(8) "&wreath;"
 
30
string(7) "&oplus;"
 
31
string(8) "&otimes;"
 
32
string(6) "&perp;"
 
33
string(6) "&sdot;"
 
34
string(7) "&lceil;"
 
35
string(7) "&rceil;"
 
36
string(8) "&lfloor;"
 
37
string(8) "&rfloor;"
 
38
string(6) "&lang;"
 
39
string(6) "&rang;"
 
40
string(6) "e28980"
 
41
string(6) "e28a95"
 
42
string(6) "e28a97"
 
43
string(6) "e28aa5"
 
44
string(6) "e28b85"
 
45
string(6) "e28c88"
 
46
string(6) "e28c89"
 
47
string(6) "e28c8a"
 
48
string(6) "e28c8b"
 
49
string(6) "e28ca9"
 
50
string(6) "e28caa"