include "skip.inc";
checkcls("HttpRequestDataShare");
?>
---INI--
-http.request.datashare.cookie = 1
--FILE--
<?php
echo "-TEST\n";
$s = HttpRequestDataShare::singleton(true);
+$s->cookie = true;
+var_dump($s);
$r1 = new HttpRequest("http://www.google.com/");
$r2 = new HttpRequest("http://www.google.com/");
$s->reset();
-var_dump(current($r1->getResponseCookies())->cookies["PREF"] === HttpUtil::parseCookie($r2->getRequestMessage()->getHeader("Cookie"))->cookies["PREF"]);
+if (current($r1->getResponseCookies())->cookies["PREF"] !== HttpUtil::parseCookie($r2->getRequestMessage()->getHeader("Cookie"))->cookies["PREF"]) {
+ var_dump(
+ current($r1->getResponseCookies())->cookies["PREF"],
+ HttpUtil::parseCookie($r2->getRequestMessage()->getHeader("Cookie"))->cookies["PREF"]
+ );
+}
echo "Done\n";
?>
--EXPECTF--
%sTEST
-bool(true)
+object(HttpRequestDataShare)#1 (4) {
+ ["cookie"]=>
+ bool(true)
+ ["dns"]=>
+ bool(true)
+ ["ssl"]=>
+ bool(false)
+ ["connect"]=>
+ bool(false)
+}
Done
Array
(
[effective_url] => http://www.google.com/
- [response_code] => %d
- [connect_code] => %d
- [filetime] => %s
+ [response_code] => 302
[total_time] => %f
[namelookup_time] => %f
[connect_time] => %f
[pretransfer_time] => %f
- [starttransfer_time] => %f
- [redirect_time] => %f
- [redirect_count] => %f
- [size_upload] => %f
+ [size_upload] => %d
[size_download] => %d
[speed_download] => %d
[speed_upload] => %d
[header_size] => %d
[request_size] => %d
[ssl_verifyresult] => %d
- [ssl_engines] => Array%s
+ [filetime] => -1
[content_length_download] => %d
[content_length_upload] => %d
- [content_type] => %s
+ [starttransfer_time] => %f
+ [content_type] => text/html
+ [redirect_time] => %d
+ [redirect_count] => %d
+ [connect_code] => %d
[httpauth_avail] => %d
- [proxyauth_avail] => %s
+ [proxyauth_avail] => %d
+ [os_errno] => %d
[num_connects] => %d
+ [ssl_engines] => Array%s
+
[cookies] => Array%s
- [os_errno] => 0
+
[error] =>
)
Array
$r->send();
$c[0] = $r->getResponseInfo("cookies");
-var_dump(empty($c[0]));
+if (!empty($c[0])) {
+ var_dump('$c[0]', $c[0]);
+}
-$r->enableCookies();
+var_dump($r->enableCookies());
$r->send();
-$c[1] = $r->getResponseInfo("cookies");
-var_dump(empty($c[1]));
-$r->resetCookies();
+$c[1] = $r->getResponseInfo("cookies");
+if (empty($c[1])) {
+ var_dump('$c[1]', $c[1]);
+}
+var_dump($r->resetCookies());
$r->send();
+
$c[2] = $r->getResponseInfo("cookies");
-var_dump($c[1] === $c[2]);
+if ($c[1] === $c[2]) {
+ var_dump('$c[1]', $c[1], '$c[2]', $c[2]);
+}
$r->send();
$c[3] = $r->getResponseInfo("cookies");
-var_dump($c[2] === $c[3]);
+if ($c[2] !== $c[3]) {
+ var_dump('$c[2]', $c[2], '$c[3]', $c[3]);
+}
echo "Done\n";
--EXPECTF--
%sTEST
bool(true)
-bool(false)
-bool(false)
bool(true)
Done