| 1 |
lars |
1 |
--TEST--
|
|
|
2 |
XML_Util tests for Bug #5392 "encoding of ISO-8859-1 is the only supported encoding"
|
|
|
3 |
--CREDITS--
|
|
|
4 |
Chuck Burgess <ashnazg@php.net>
|
|
|
5 |
# created for v1.2.0a1 2008-05-04
|
|
|
6 |
--FILE--
|
|
|
7 |
<?php
|
|
|
8 |
require_once 'XML' . DIRECTORY_SEPARATOR . 'Util.php';
|
|
|
9 |
echo '=====XML_Util tests for Bug #5392 "encoding of ISO-8859-1 is the only supported encoding"=====' . PHP_EOL . PHP_EOL;
|
|
|
10 |
|
|
|
11 |
echo "TEST: test case provided in bug report" . PHP_EOL;
|
|
|
12 |
$data = 'This data contains special chars like <, >, & and " as well as ä, ö, ß, à and ê';
|
|
|
13 |
|
|
|
14 |
$replaced = XML_Util::replaceEntities($data, XML_UTIL_ENTITIES_HTML, 'UTF-8');
|
|
|
15 |
|
|
|
16 |
$reversed = XML_Util::reverseEntities($replaced, XML_UTIL_ENTITIES_HTML, 'UTF-8');
|
|
|
17 |
|
|
|
18 |
echo $replaced . PHP_EOL;
|
|
|
19 |
echo $reversed . PHP_EOL;
|
|
|
20 |
|
|
|
21 |
?>
|
|
|
22 |
--EXPECT--
|
|
|
23 |
=====XML_Util tests for Bug #5392 "encoding of ISO-8859-1 is the only supported encoding"=====
|
|
|
24 |
|
|
|
25 |
TEST: test case provided in bug report
|
|
|
26 |
This data contains special chars like <, >, & and " as well as ä, ö, ß, à and ê
|
|
|
27 |
This data contains special chars like <, >, & and " as well as ä, ö, ß, à and ê
|