add a test for the new demo
authorgggeek <giunta.gaetano@gmail.com>
Tue, 17 Jan 2023 12:11:25 +0000 (12:11 +0000)
committergggeek <giunta.gaetano@gmail.com>
Tue, 17 Jan 2023 12:11:25 +0000 (12:11 +0000)
demo/client/windowscharset.php
tests/7DemofilesTest.php

index c785cd7..3c39917 100644 (file)
@@ -11,6 +11,10 @@ use PhpXmlRpc\PhpXmlRpc;
 use PhpXmlRpc\Request;
 use PhpXmlRpc\Value;
 
+if (!function_exists('mb_convert_encoding')) {
+    die('This demo requires mbstring support');
+}
+
 PhpXmlRpc::$xmlrpc_internalencoding = 'Windows-1252';
 
 // this is a very contrived way of creating a CP-1252 string...
@@ -28,11 +32,11 @@ $c = new Client(XMLRPCSERVER);
 
 // allow the full request and response to be seen on screen
 $c->setDebug(2);
-// tell the server not to compress the response
+// tell the server not to compress the response - this is not necessary btw, it is only done to make the debug look nicer
 $c->accepted_compression = array();
-// tell the server not to encode everything as ASCII - this is not necessary btw. It is only done to make the demo nicer
+// tell the server not to encode everything as ASCII - this is not necessary btw, it is only done to make the debug look nicer
 $c->accepted_charset_encodings = array('UTF-8');
-// force the client not to encode everything as ASCII - this is not necessary btw. It is only done to make the demo nicer
+// force the client not to encode everything as ASCII - this is not necessary btw, it is only done to make the debug nicer
 $c->request_charset_encoding = 'UTF-8';
 
 $r = $c->send(new Request('examples.stringecho', array(new Value($input))));
index bb74546..fe8b228 100644 (file)
@@ -59,6 +59,11 @@ class DemoFilesTest extends PhpXmlRpc_WebTestCase
         $page = $this->request('?demo=client/which.php');
     }
 
+    public function testWindowsCharset()
+    {
+        $page = $this->request('?demo=client/windowscharset.php');
+    }
+
     public function testWrap()
     {
         $page = $this->request('?demo=client/wrap.php');