5.3 compatibility
[m6w6/ext-http] / tests / client030.phpt
1 --TEST--
2 client eventloop recursion
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 ?>
7 --FILE--
8 <?php
9 echo "Test\n";
10
11 include "helper/server.inc";
12
13 class test implements SplObserver {
14 function update(SplSubject $client) {
15 $client->once();
16 }
17 }
18 server("proxy.inc", function($port) {
19 $client = new http\Client;
20 $client->configure(array(
21 "use_eventloop" => true,
22 ));
23 $client->attach(new test);
24 $client->enqueue(new http\Client\Request("GET", "http://localhost:$port/"), function($r) {
25 var_dump($r->getResponseCode());
26 });
27 $client->send();
28 });
29
30 ?>
31 ===DONE===
32 --EXPECTF--
33 Test
34 int(200)
35 ===DONE===