prepare v4.2.5
[m6w6/ext-http] / tests / client008.phpt
index d7fe35822517fed372a1a254fdcfcbd79389db91..616a9e427ec5c36c9f7d06d3975d8ac36ca464e5 100644 (file)
@@ -1,30 +1,40 @@
 --TEST--
-client features
+client pipelining
 --SKIPIF--
 <?php
 include "skipif.inc";
+skip_client_test();
+if (version_compare(http\Client\Curl\Versions\CURL, "7.62.0", ">=")) {
+       die("skip CURL_VERSION >= 7.62 -- pipelining disabled\n");
+}
 ?>
 --FILE--
 <?php
-echo "Test\n";
 
-$request = new http\Client\Request("GET", "http://www.example.org");
+include "helper/server.inc";
+
+echo "Test\n";
 
-foreach (http\Client::getAvailableDrivers() as $driver) {
-       $client = new http\Client($driver);
-       $client->enablePipelining(true);
-       $client->enableEvents(true);
+server("pipeline.inc", function($port, $stdin) {
+       fputs($stdin, "2\n");
        
+       $request = new http\Client\Request("GET", "http://localhost:$port");
+       
+       $client = new http\Client();
+       $client->configure(array("pipelining" => true, "use_eventloop" => true));
+
        $client->enqueue($request);
+       $client->send();
+       
        $client->enqueue(clone $request);
        $client->enqueue(clone $request);
-       
+
        $client->send();
-       
+
        while ($client->getResponse()) {
                echo "R\n";
        }
-}
+});
 
 ?>
 Done