Changeset 1164
- Timestamp:
- 12/19/07 17:50:28 (10 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/test/php/net/stubbles/xml/unserializer/stubXMLUnserializerTestCase.php
r1163 r1164 22 22 public function testUnserializeAnyXML() 23 23 { 24 $xml = '<users>' . 24 $xml = '<?xml version="1.0" encoding="iso-8859-1"?>' . 25 '<users>' . 25 26 ' <user handle="schst">Stephan Schmidt</user>' . 26 27 ' <user handle="mikey">Frank Kleine</user>' . … … 49 50 public function testUnserializeList() 50 51 { 51 $xml1 = '<root> 52 $xml1 = '<?xml version="1.0" encoding="iso-8859-1"?> 53 <root> 52 54 <item> 53 55 <name>schst</name> … … 58 60 </root>'; 59 61 60 $xml2 = '<root> 62 $xml2 = '<?xml version="1.0" encoding="iso-8859-1"?> 63 <root> 61 64 <item> 62 65 <name>schst</name> … … 78 81 public function testWhiteSpaceTrim() 79 82 { 80 $xml = '<xml> 83 $xml = '<?xml version="1.0" encoding="iso-8859-1"?> 84 <xml> 81 85 <string> 82 86 … … 102 106 public function testWhiteSpaceNormalize() 103 107 { 104 $xml = '<xml> 108 $xml = '<?xml version="1.0" encoding="iso-8859-1"?> 109 <xml> 105 110 <string> 106 111 … … 122 127 public function testWhiteSpaceKeep() 123 128 { 124 $xml = '<xml> 129 $xml = '<?xml version="1.0" encoding="iso-8859-1"?> 130 <xml> 125 131 <string> 126 132 … … 167 173 public function testUnserializeWithTagMap() 168 174 { 169 $xml1 = '<root>' . 175 $xml1 = '<?xml version="1.0" encoding="iso-8859-1"?>' . 176 '<root>' . 170 177 ' <foo>FOO</foo>' . 171 178 ' <bar>BAR</bar>' . 172 179 '</root>'; 173 $xml2 = '<root>' . 180 $xml2 = '<?xml version="1.0" encoding="iso-8859-1"?>' . 181 '<root>' . 174 182 ' <foo>'. 175 183 ' <tomato>45</tomato>'. … … 199 207 public function testUnserializeWithTypeGuessing() 200 208 { 201 $xml = '<root>' . 209 $xml = '<?xml version="1.0" encoding="iso-8859-1"?>' . 210 '<root>' . 202 211 ' <string>Just a string...</string>' . 203 212 ' <booleanValue>true</booleanValue>' . … … 228 237 $this->assertTrue($result['array']['_content']); 229 238 } 239 240 /** 241 * assert that output encoding is UTF-8 242 */ 243 public function testReturnEncoding() 244 { 245 $xml = '<?xml version="1.0" encoding="iso-8859-1"?><root><string>A string containing german umlauts: äöü</string></root>'; 246 $unserializer = new stubXMLUnserializer(); 247 $this->assertEqual($unserializer->unserialize($xml), array('string' => utf8_encode('A string containing german umlauts: äöü'))); 248 } 230 249 } 231 250 ?>
