From: gggeek Date: Sun, 12 Apr 2015 11:59:05 +0000 (+0100) Subject: Make latin-1 tests more ide-proof X-Git-Tag: 4.0.0-alpha^2~93 X-Git-Url: http://git.onelab.eu/?p=plcapi.git;a=commitdiff_plain;h=568742e1a2911037c8d164716c138aa2cce74039 Make latin-1 tests more ide-proof --- diff --git a/tests/1ParsingBugsTest.php b/tests/1ParsingBugsTest.php index 33915ca..e4a3048 100644 --- a/tests/1ParsingBugsTest.php +++ b/tests/1ParsingBugsTest.php @@ -413,52 +413,56 @@ and there they were.postid7414222userid311127 -dateCreated20011126T09:17:52content' . utf8_encode('������') . 'postid7414222 +dateCreated20011126T09:17:52content' . utf8_encode($string) . 'postid7414222 '; $r = $s->parseResponse($f, false, 'phpvals'); $v = $r->value(); $v = $v['content']; - $this->assertEquals("������", $v); + $this->assertEquals($string, $v); $f = 'userid311127 -dateCreated20011126T09:17:52content' . utf8_encode('������') . 'postid7414222 +dateCreated20011126T09:17:52content' . utf8_encode($string) . 'postid7414222 '; $r = $s->parseResponse($f, false, 'phpvals'); $v = $r->value(); $v = $v['content']; - $this->assertEquals("������", $v); + $this->assertEquals($string, $v); $r = php_xmlrpc_decode_xml($f); $v = $r->value(); $v = $v->structmem('content')->scalarval(); - $this->assertEquals("������", $v); + $this->assertEquals($string, $v); } public function testLatin1Response() { + $string = chr(224) . chr(252) . chr(232); + $s = new xmlrpcmsg('dummy'); $f = "HTTP/1.1 200 OK\r\nContent-type: text/xml; charset=ISO-8859-1\r\n\r\n" . 'userid311127 -dateCreated20011126T09:17:52content' . '������' . 'postid7414222 +dateCreated20011126T09:17:52content' . $string . 'postid7414222 '; $r = $s->parseResponse($f, false, 'phpvals'); $v = $r->value(); $v = $v['content']; - $this->assertEquals("������", $v); + $this->assertEquals($string, $v); $f = 'userid311127 -dateCreated20011126T09:17:52content' . '������' . 'postid7414222 +dateCreated20011126T09:17:52content' . $string . 'postid7414222 '; $r = $s->parseResponse($f, false, 'phpvals'); $v = $r->value(); $v = $v['content']; - $this->assertEquals("������", $v); + $this->assertEquals($string, $v); $r = php_xmlrpc_decode_xml($f); $v = $r->value(); $v = $v->structmem('content')->scalarval(); - $this->assertEquals("������", $v); + $this->assertEquals($string, $v); } public function testUTF8IntString()