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