travis: condense build matrix
[m6w6/ext-http] / tests / client004.phpt
1 --TEST--
2 client reset
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 server("proxy.inc", function($port) {
16 $request = new http\Client\Request("GET", "http://localhost:$port");
17
18 foreach (http\Client::getAvailableDrivers() as $driver) {
19 $client = new http\Client($driver);
20 $client->enqueue($request)->send();
21 if (!($client->getResponse($request) instanceof http\Client\Response)) {
22 var_dump($client);
23 }
24 try {
25 $client->enqueue($request);
26 } catch (Exception $e) {
27 echo $e->getMessage(),"\n";
28 }
29 $client->reset();
30 if (($response = $client->getResponse())) {
31 var_dump($response);
32 }
33 $client->enqueue($request);
34 }
35 });
36 ?>
37 Done
38 --EXPECTREGEX--
39 Test
40 (?:Failed to enqueue request; request already in queue
41 )+Done