From: Michael Wallner Date: Fri, 29 Sep 2006 09:07:03 +0000 (+0000) Subject: - fix tests X-Git-Tag: RELEASE_1_3_1~4 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=d74c9c7fc9807141e6500a525ab5c80fc9524a34;p=m6w6%2Fext-http - fix tests --- diff --git a/tests/HttpRequestDataShare_002.phpt b/tests/HttpRequestDataShare_002.phpt index 0b2f0ac..1c7aa6f 100644 --- a/tests/HttpRequestDataShare_002.phpt +++ b/tests/HttpRequestDataShare_002.phpt @@ -5,13 +5,13 @@ HttpRequestDataShare global include "skip.inc"; checkcls("HttpRequestDataShare"); ?> ---INI-- -http.request.datashare.cookie = 1 --FILE-- cookie = true; +var_dump($s); $r1 = new HttpRequest("http://www.google.com/"); $r2 = new HttpRequest("http://www.google.com/"); @@ -27,11 +27,25 @@ $r2->send(); $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 diff --git a/tests/HttpRequest_002.phpt b/tests/HttpRequest_002.phpt index a556977..a51f00b 100644 --- a/tests/HttpRequest_002.phpt +++ b/tests/HttpRequest_002.phpt @@ -32,32 +32,34 @@ echo "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 diff --git a/tests/HttpRequest_010.phpt b/tests/HttpRequest_010.phpt index 4559be2..13acd5f 100644 --- a/tests/HttpRequest_010.phpt +++ b/tests/HttpRequest_010.phpt @@ -14,28 +14,35 @@ $r = new HttpRequest("http://dev.iworks.at/.cookie.php"); $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