projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Fix: curl_easy_setopt expects a curl_write_callback argument for this option
[m6w6/ext-http]
/
tests
/
client009.phpt
diff --git
a/tests/client009.phpt
b/tests/client009.phpt
index 937045d061e2246f69d27b0f8dc791791e262ce6..0eb08f73a96f0c2e779a677854da3c3788713522 100644
(file)
--- a/
tests/client009.phpt
+++ b/
tests/client009.phpt
@@
-3,45
+3,49
@@
client static cookies
--SKIPIF--
<?php
include "skipif.inc";
--SKIPIF--
<?php
include "skipif.inc";
+skip_client_test();
?>
--FILE--
<?php
?>
--FILE--
<?php
-echo "Test\n";
-$request = new http\Client\Request("GET", "http://dev.iworks.at/ext-http/.print_request.php");
+include "helper/server.inc";
+
+echo "Test\n";
function x($a) {
$r[key($a)]=end($a);
$r[key($a)]=reset($a);
return $r;
}
function x($a) {
$r[key($a)]=end($a);
$r[key($a)]=reset($a);
return $r;
}
-foreach (http\Client::getAvailableDrivers() as $driver) {
- $client = new http\Client($driver);
+
+server("env.inc", function($port) {
+ $client = new http\Client;
$client->setCookies(array("test" => "bar"));
$client->addCookies(array("foo" => "test"));
$client->setCookies(array("test" => "bar"));
$client->addCookies(array("foo" => "test"));
+
+ $request = new http\Client\Request("GET", "http://localhost:$port");
$client->enqueue($request);
$client->send();
$client->enqueue($request);
$client->send();
- var_dump($client->getResponse()->getBody()->toString());
+ echo $client->getResponse()->getBody()->toString();
+
$request->setOptions(array("cookies" => x($client->getCookies())));
$client->requeue($request);
$client->send();
$request->setOptions(array("cookies" => x($client->getCookies())));
$client->requeue($request);
$client->send();
- var_dump($client->getResponse()->getBody()->toString());
-}
+ echo $client->getResponse()->getBody()->toString();
+});
?>
Done
?>
Done
---EXPECT
REGEX
--
+--EXPECT--
Test
Test
-(?:string\(46\) "Array
-\(
- \[test\] \=\> bar
- \[foo\] \=\> test
-\)
-"
-string\(46\) "Array
-\(
- \[test\] \=\> test
- \[foo\] \=\> bar
-\)
-"
-)+Done
+Array
+(
+ [test] => bar
+ [foo] => test
+)
+Array
+(
+ [test] => test
+ [foo] => bar
+)
+Done