From 568742e1a2911037c8d164716c138aa2cce74039 Mon Sep 17 00:00:00 2001 From: gggeek Date: Sun, 12 Apr 2015 12:59:05 +0100 Subject: [PATCH] Make latin-1 tests more ide-proof --- tests/1ParsingBugsTest.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) 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() -- 2.43.0