From: gggeek Date: Sun, 12 Jul 2015 13:07:43 +0000 (+0100) Subject: One more character-set related test X-Git-Tag: 4.0.0-alpha^2~6 X-Git-Url: http://git.onelab.eu/?p=plcapi.git;a=commitdiff_plain;h=aa3574e0024996a06e7a19a28301944ae6c65fa1 One more character-set related test --- diff --git a/tests/3LocalhostTest.php b/tests/3LocalhostTest.php index bf51721..0290dbf 100644 --- a/tests/3LocalhostTest.php +++ b/tests/3LocalhostTest.php @@ -241,6 +241,31 @@ class LocalhostTest extends PHPUnit_Framework_TestCase PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding = 'ISO-8859-1'; } + public function testExoticCharsetsRequests3() + { + // note that we should disable this call also when mbstring is missing server-side + if (!function_exists('mb_convert_encoding')) { + $this->markTestSkipped('Miss mbstring extension to test exotic charsets'); + return; + } + $sendString = utf8_decode('élève'); + $str = ' + + examples.stringecho + + + '.$sendString.' + + +'; + + // no encoding declaration either in the http header or xml prolog, let mb_detect_encoding + // (used on the server side) sort it out + $this->client->path = $this->args['URI'].'?DETECT_ENCODINGS[]=ISO-8859-1&DETECT_ENCODINGS[]=UTF-8'; + $v = $this->send($str); + $this->assertEquals($sendString, $v->scalarval()); + } + /*public function testLatin1Method() { $f = new xmlrpcmsg("tests.iso88591methodname." . chr(224) . chr(252) . chr(232), array(