HEX
Server: Apache/2.4.41 (Amazon) OpenSSL/1.0.2k-fips PHP/5.6.40
System: Linux ip-172-31-40-18 4.14.146-93.123.amzn1.x86_64 #1 SMP Tue Sep 24 00:45:23 UTC 2019 x86_64
User: apache (48)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: //usr/share/pear/test/pecl_http/tests/client009.phpt
--TEST--
client static cookies
--SKIPIF--
<?php
include "skipif.inc";
?>
--FILE--
<?php
echo "Test\n";

$request = new http\Client\Request("GET", "http://dev.iworks.at/ext-http/.print_request.php");

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);
	$client->setCookies(array("test" => "bar"));
	$client->addCookies(array("foo" => "test"));
	$client->enqueue($request);
	$client->send();
	var_dump($client->getResponse()->getBody()->toString());
	$request->setOptions(array("cookies" => x($client->getCookies())));
	$client->requeue($request);
	$client->send();
	var_dump($client->getResponse()->getBody()->toString());
}

?>
Done
--EXPECTREGEX--
Test
(?:string\(46\) "Array
\(
    \[test\] \=\> bar
    \[foo\] \=\> test
\)
"
string\(46\) "Array
\(
    \[test\] \=\> test
    \[foo\] \=\> bar
\)
"
)+Done