improve negotiation precision
[m6w6/ext-http] / tests / client002.phpt
1 --TEST--
2 client observer
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 skip_client_test();
7 ?>
8 --FILE--
9 <?php
10
11 include "helper/server.inc";
12
13 echo "Test\n";
14
15 class Observer implements SplObserver
16 {
17 function update(SplSubject $client, http\Client\Request $request = null, StdClass $progress = null) {
18 echo "P";
19 if ($client->getProgressInfo($request) != $progress) {
20 var_dump($progress);
21 }
22 }
23 }
24
25 server("proxy.inc", function($port, $stdin, $stdout, $stderr) {
26 foreach (http\Client::getAvailableDrivers() as $driver) {
27 $client = new http\Client($driver);
28 $client->attach(new Observer);
29 $client->enqueue(new http\Client\Request("GET", "http://localhost:$port/"));
30 $client->send();
31 }
32 });
33
34 ?>
35
36 Done
37 --EXPECTREGEX--
38 Test
39 P+
40 Done