Config.w32: add curl dependent libs
[m6w6/ext-http] / tests / gh-issue50.phpt
1 --TEST--
2 segfault with Client::setDebug and Client::dequeue()
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 skip_client_test();
7 skip_online_test();
8 ?>
9 --FILE--
10 <?php
11 echo "Test\n";
12
13 $c = new http\Client;
14 $c->enqueue(new http\Client\Request("GET", "http://example.com"));
15
16 $c->setDebug(function(http\Client $c, http\Client\Request $r, $type, $data) {
17 if ($type & http\Client::DEBUG_HEADER) {
18 $c->dequeue($r);
19 }
20 });
21
22 try {
23 $c->send();
24 } catch (Exception $e) {
25 echo $e;
26 }
27
28 ?>
29
30 ===DONE===
31 --EXPECTF--
32 Test
33 http\Exception\RuntimeException: http\Client::dequeue(): Could not dequeue request while executing callbacks in %sgh-issue50.php:9
34 Stack trace:
35 #0 %sgh-issue50.php(9): http\Client->dequeue(Object(http\Client\Request))
36 #1 [internal function]: {closure}(Object(http\Client), Object(http\Client\Request), 18, 'GET / HTTP/1.1%s...')
37 #2 %sgh-issue50.php(14): http\Client->send()
38 #3 {main}
39 ===DONE===