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