reduce count of online tests
[m6w6/ext-http] / tests / client002.phpt
index 89d4d658b8a58ee2d5cfcf94cf72ca4b8c319bbe..e07b82e21669fff8e5e38e250611c8c4397993c5 100644 (file)
@@ -3,10 +3,13 @@ client observer
 --SKIPIF--
 <?php
 include "skipif.inc";
-skip_online_test();
+skip_client_test();
 ?>
 --FILE--
 <?php
+
+include "server.inc";
+
 echo "Test\n";
 
 class Observer implements SplObserver
@@ -19,15 +22,14 @@ class Observer implements SplObserver
        }
 }
 
-$observer = new Observer;
-$request = new http\Client\Request("GET", "http://www.example.org/");
-
-foreach (http\Client::getAvailableDrivers() as $driver) {
-       $client = new http\Client($driver);
-       $client->attach($observer);
-       $client->enqueue($request);
-       $client->send();
-}
+server("proxy.inc", function($port, $stdin, $stdout, $stderr) {
+       foreach (http\Client::getAvailableDrivers() as $driver) {
+               $client = new http\Client($driver);
+               $client->attach(new Observer);
+               $client->enqueue(new http\Client\Request("GET", "http://localhost:$port/"));
+               $client->send();
+       }
+});
 
 ?>