Possible null pointer dereference in php_http_url_mod() fixed.
[m6w6/ext-http] / tests / client010.phpt
1 --TEST--
2 client upload
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 skip_online_test();
7 skip_client_test();
8 ?>
9 --FILE--
10 <?php
11 echo "Test\n";
12
13 $RE =
14 '/(Array
15 \(
16 \[upload\] \=\> Array
17 \(
18 \[name\] \=\> client010\.php
19 \[type\] \=\> text\/plain
20 \[tmp_name\] \=\> .+
21 \[error\] \=\> 0
22 \[size\] \=\> \d+
23 \)
24
25 \)
26 )+/';
27 $request = new http\Client\Request("POST", "http://dev.iworks.at/ext-http/.print_request.php");
28 $request->getBody()->addForm(null, array("file"=>__FILE__, "name"=>"upload", "type"=>"text/plain"));
29
30 foreach (http\Client::getAvailableDrivers() as $driver) {
31 $client = new http\Client($driver);
32 $client->enqueue($request)->send();
33 if (!preg_match($RE, $s = $client->getResponse()->getBody()->toString())) {
34 echo($s);
35 }
36 }
37 ?>
38 Done
39 --EXPECT--
40 Test
41 Done