WIP more support for xmlrpc-polyfill
[plcapi.git] / tests / 4LocalhostMultiTest.php
index f4c5b17..619e3ae 100644 (file)
@@ -16,13 +16,13 @@ class LocalhostMultiTest extends LocalhostTest
     /**
      * Returns all test methods from the base class, except the ones which failed already
      *
-     * @todo reintroduce skipping of tests which failed when executed individually if test runs happen as separate processes
+     * @todo (re)introduce skipping of tests which failed when executed individually even if test runs happen as separate processes
      * @todo reintroduce skipping of tests within the loop
      */
     public function getSingleHttpTestMethods()
     {
         $unsafeMethods = array(
-            'testHttps', 'testCatchExceptions', 'testUtf8Method', 'testServerComments',
+            'testCatchExceptions', 'testUtf8Method', 'testServerComments',
             'testExoticCharsetsRequests', 'testExoticCharsetsRequests2', 'testExoticCharsetsRequests3',
         );
 
@@ -103,7 +103,7 @@ class LocalhostMultiTest extends LocalhostTest
     {
         if ($this->args['PROXYSERVER'] == '')
         {
-            $this->markTestSkipped('PROXY definition missing: cannot test proxy');
+            $this->markTestSkipped('PROXYSERVER definition missing: cannot test proxy');
             return;
         }
 
@@ -131,6 +131,26 @@ class LocalhostMultiTest extends LocalhostTest
         $this->$method();
     }
 
+    /**
+     * @dataProvider getSingleHttpTestMethods
+     * @param string $method
+     */
+    public function testHttp10Curl($method)
+    {
+        if(!function_exists('curl_init'))
+        {
+            $this->markTestSkipped('CURL missing: cannot test http 1.1');
+            return;
+        }
+
+        $this->method = 'http10'; // not an error the double assignment!
+        $this->client->method = 'http10';
+        $this->client->keepalive = false;
+        $this->client->setUseCurl(\PhpXmlRpc\Client::USE_CURL_ALWAYS);
+
+        $this->$method();
+    }
+
     /**
      * @dataProvider getSingleHttpTestMethods
      * @param string $method
@@ -184,7 +204,7 @@ class LocalhostMultiTest extends LocalhostTest
         }
         else if ($this->args['PROXYSERVER'] == '')
         {
-            $this->markTestSkipped('PROXY definition missing: cannot test proxy w. http 1.1');
+            $this->markTestSkipped('PROXYSERVER definition missing: cannot test proxy w. http 1.1');
             return;
         }
 
@@ -224,6 +244,30 @@ class LocalhostMultiTest extends LocalhostTest
         $this->$method();
     }
 
+    /**
+     * @dataProvider getSingleHttpTestMethods
+     * @param string $method
+     */
+    public function testHttpsSocket($method)
+    {
+        if ($this->args['HTTPSSERVER'] == '')
+        {
+            $this->markTestSkipped('HTTPS SERVER definition missing: cannot test https');
+            return;
+        }
+
+        $this->client->server = $this->args['HTTPSSERVER'];
+        $this->method = 'https';
+        $this->client->method = 'https';
+        $this->client->path = $this->args['HTTPSURI'];
+        $this->client->setSSLVerifyPeer(!$this->args['HTTPSIGNOREPEER']);
+        $this->client->setSSLVerifyHost($this->args['HTTPSVERIFYHOST']);
+        $this->client->setSSLVersion($this->args['SSLVERSION']);
+        $this->client->setUseCurl(\PhpXmlRpc\Client::USE_CURL_NEVER);
+
+        $this->$method();
+    }
+
     /**
      * @dataProvider getSingleHttpTestMethods
      * @param string $method
@@ -237,7 +281,7 @@ class LocalhostMultiTest extends LocalhostTest
         }
         else if ($this->args['PROXYSERVER'] == '')
         {
-            $this->markTestSkipped('PROXY definition missing: cannot test proxy w. https');
+            $this->markTestSkipped('PROXYSERVER definition missing: cannot test proxy w. https');
             return;
         }
         else if ($this->args['HTTPSSERVER'] == '')