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