- fix tests
authorMichael Wallner <mike@php.net>
Fri, 20 Apr 2007 09:27:24 +0000 (09:27 +0000)
committerMichael Wallner <mike@php.net>
Fri, 20 Apr 2007 09:27:24 +0000 (09:27 +0000)
14 files changed:
tests/HttpRequestDataShare_001.phpt
tests/HttpRequestDataShare_002.phpt
tests/HttpRequestPool_001.phpt
tests/HttpRequestPool_002.phpt
tests/HttpRequest_002.phpt
tests/HttpRequest_004.phpt
tests/HttpRequest_006.phpt
tests/HttpRequest_007.phpt
tests/HttpRequest_008.phpt
tests/HttpRequest_009.phpt
tests/HttpRequest_010.phpt
tests/request_cookies.phpt
tests/request_gzip.phpt
tests/request_put_data.phpt

index d1b18e86eff68260ddf0bd6a0c0af19581685a87..cdbdc36c57ce715478e6508c6623ac71350606e0 100644 (file)
@@ -3,6 +3,7 @@ HttpRequestDataShare
 --SKIPIF--
 <?php
 include "skip.inc";
+checkurl("www.google.com");
 checkcls("HttpRequestDataShare");
 ?>
 --FILE--
index 1c7aa6fd5589ddc7e7192417693b2a252ff93996..4c61a796e64067bb7cd017eef320ce1c65e60b3d 100644 (file)
@@ -3,6 +3,7 @@ HttpRequestDataShare global
 --SKIPIF--
 <?php
 include "skip.inc";
+checkurl("www.google.com");
 checkcls("HttpRequestDataShare");
 ?>
 --FILE--
index 1cfcfc80d32b64967f6f290df935727607a2531b..4008e500daede6095faeee3e99a182af93d44a82 100644 (file)
@@ -6,20 +6,16 @@ include 'skip.inc';
 checkmin(5);
 checkcls('HttpRequestPool');
 checkurl('www.php.net');
-checkurl('de.php.net');
-checkurl('at.php.net');
 checkurl('dev.iworks.at');
 ?>
 --FILE--
 <?php
 echo "-TEST\n";
-$post = new HttpRequest('http://dev.iworks.at/.print_request.php', HTTP_METH_POST);
+$post = new HttpRequest('http://dev.iworks.at/ext-http/.print_request.php', HTTP_METH_POST);
 $post->addPostFields(array('a'=>1,'b'=>2)) ;
 
 $pool = new HttpRequestPool(
     new HttpRequest('http://www.php.net/', HTTP_METH_HEAD),
-    new HttpRequest('http://at.php.net/', HTTP_METH_HEAD),
-    new HttpRequest('http://de.php.net/', HTTP_METH_HEAD),
     $post
 );
 
@@ -49,11 +45,7 @@ echo "Done\n";
 --EXPECTF--
 %sTEST
 http://www.php.net/=200:200
-http://at.php.net/=200:200
-http://de.php.net/=200:200
-http://dev.iworks.at/.print_request.php=200:200
-.
-.
+http://dev.iworks.at/ext-http/.print_request.php=200:200
 .
 .
 Done
index e15a7561ad72fed574621a1dff2d61ca4a96517e..94fd2c5464b832932a1c72c30de6f574e5eb09a7 100644 (file)
@@ -4,8 +4,6 @@ extending HttpRequestPool
 <?php
 include 'skip.inc';
 checkcls('HttpRequestPool');
-checkurl('at.php.net');
-checkurl('de.php.net');
 checkurl('www.php.net');
 ?>
 --FILE--
@@ -39,8 +37,8 @@ class MyPool extends HttpRequestPool
 
 $pool = new MyPool(
     new HttpRequest('http://www.php.net/', HTTP_METH_HEAD),
-    new HttpRequest('http://at.php.net/', HTTP_METH_HEAD),
-    new HttpRequest('http://de.php.net/', HTTP_METH_HEAD)
+    new HttpRequest('http://www.php.net/', HTTP_METH_HEAD),
+    new HttpRequest('http://www.php.net/', HTTP_METH_HEAD)
 );
 
 $pool->send();
index a51f00b32971d11251b278fe5bb0a4bc62197d37..5710d598f565e12011b0bd842fbe72a4dab9572f 100644 (file)
@@ -16,7 +16,7 @@ $r = new HttpRequest('http://www.google.com', HttpRequest::METH_GET);
 $r->send();
 print_r($r->getResponseInfo());
 
-$r = new HttpRequest('http://dev.iworks.at/.print_request.php', HTTP_METH_POST);
+$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_request.php', HTTP_METH_POST);
 $r->addCookies(array('MyCookie' => 'foobar'));
 $r->addQueryData(array('gq'=>'foobar','gi'=>10));
 $r->addPostFields(array('pq'=>'foobar','pi'=>10));
index 4c253e095ab8c5ede1c181a0c96c6c7887b01270..dd710f0d27be7e2f36134d33f3289b2c44669618 100644 (file)
@@ -15,7 +15,7 @@ $fields = array(
 );
 
 echo "\nFirst Request\n";
-$r = new HttpRequest('http://dev.iworks.at/.print_request.php', HttpRequest::METH_POST);
+$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_request.php', HttpRequest::METH_POST);
 $r->setPostFields($fields[0]);
 $r->addPostFields($fields[1]);
 var_dump($r->send()->getBody());
index 68c3ffecd84b420a478e2477f7d7a6a8709cb1e1..24ee8a1ab42b8e1b676de79b7e3449c1b94e2d86 100644 (file)
@@ -10,7 +10,7 @@ checkcls('HttpRequest');
 <?php
 echo "-TEST\n";
 
-$r = new HttpRequest('http://dev.iworks.at/.print_request.php', HTTP_METH_POST);
+$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_request.php', HTTP_METH_POST);
 $r->setContentType('text/xml');
 $r->setBody(xmlrpc_encode_request('testMethod', array('foo' => 'bar')));
 var_dump($r->send());
index 1f31404af3f6cdccbfbfab3da77d5d76423a3758..f440c83d2776b7e6a7a7916bfeb7958edd9822c5 100644 (file)
@@ -9,7 +9,7 @@ checkcls('HttpRequest');
 <?php
 echo "-TEST\n";
 
-$r = new HttpRequest('http://dev.iworks.at/.print_put.php5', HTTP_METH_PUT);
+$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_put.php5', HTTP_METH_PUT);
 $r->recordHistory = true;
 $r->addHeaders(array('content-type' => 'text/plain'));
 $r->setPutFile(__FILE__);
@@ -19,18 +19,18 @@ echo "Done\n";
 ?>
 --EXPECTF--
 %sTEST
-string(%d) "PUT /.print_put.php5 HTTP/1.1
+string(%d) "PUT /ext-http/.print_put.php5 HTTP/1.1
 User-Agent: PECL::HTTP/%s
 Host: dev.iworks.at
 Accept: */*
 Content-Type: text/plain
-Content-Length: 281
+Content-Length: %d
 Expect: 100-continue
 
 <?php
 echo "-TEST\n";
 
-$r = new HttpRequest('http://dev.iworks.at/.print_put.php5', HTTP_METH_PUT);
+$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_put.php5', HTTP_METH_PUT);
 $r->recordHistory = true;
 $r->addHeaders(array('content-type' => 'text/plain'));
 $r->setPutFile(__FILE__);
@@ -45,14 +45,13 @@ Date: %s
 Server: %s
 X-Powered-By: %s
 Vary: Accept-Encoding
+Content-Length: %d
 Content-Type: text/html
-X-Original-Transfer-Encoding: chunked
-Content-Length: 281
 
 <?php
 echo "-TEST\n";
 
-$r = new HttpRequest('http://dev.iworks.at/.print_put.php5', HTTP_METH_PUT);
+$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_put.php5', HTTP_METH_PUT);
 $r->recordHistory = true;
 $r->addHeaders(array('content-type' => 'text/plain'));
 $r->setPutFile(__FILE__);
index 7b32439f8b724be2deb80c18c3f1ec6b161e3a71..638d4c8d080280e9b66d2ff3a25fce3b1b479178 100644 (file)
@@ -10,7 +10,7 @@ checkcls('HttpRequest');
 echo "-TEST\n";
 
 HttpRequest::methodRegister('foobar');
-$r = new HttpRequest('http://dev.iworks.at/.print_request.php', HttpRequest::METH_FOOBAR);
+$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_request.php', HttpRequest::METH_FOOBAR);
 $r->setContentType('text/plain');
 $r->setBody('Yep, this is FOOBAR!');
 var_dump($r->send()->getResponseCode());
@@ -21,7 +21,7 @@ echo "Done\n";
 --EXPECTF--
 %sTEST
 int(200)
-string(%d) "FOOBAR /.print_request.php HTTP/1.1
+string(%d) "FOOBAR /ext-http/.print_request.php HTTP/1.1
 User-Agent: %s
 Host: dev.iworks.at
 Accept: */*
index ead16d8b69eedf3077204ff28656c1bcf0db9ba0..e74121a789bd09deb0d1744301e48747909b0f58 100644 (file)
@@ -22,7 +22,7 @@ class _R extends HttpRequest
        }
 }
 
-$r = new _R('http://dev.iworks.at/.print_request.php', HTTP_METH_POST);
+$r = new _R('http://dev.iworks.at/ext-http/.print_request.php', HTTP_METH_POST);
 $r->addPostFile('upload', __FILE__, 'text/plain');
 $r->send();
 
index 13acd5fad74b8120340bdaee69911cb70959e7eb..10ec767477191468744a30bd7a8d7191c90354d6 100644 (file)
@@ -10,7 +10,7 @@ checkcls("HttpRequest");
 <?php
 echo "-TEST\n";
 
-$r = new HttpRequest("http://dev.iworks.at/.cookie.php");
+$r = new HttpRequest("http://dev.iworks.at/ext-http/.cookie.php");
 
 $r->send();
 $c[0] = $r->getResponseInfo("cookies");
index 38428f3ca76271969cf64248ec8f3fab141a2fc2..8488b9d6c5a94d26840b464eeb131913ed014570 100644 (file)
@@ -12,7 +12,7 @@ echo "-TEST\n";
 
 $cookies = array("name" => "val=ue");
 
-$r = new HttpRequest("http://dev.iworks.at/.print_request.php", HTTP_METH_GET, array("cookies" => $cookies));
+$r = new HttpRequest("http://dev.iworks.at/ext-http/.print_request.php", HTTP_METH_GET, array("cookies" => $cookies));
 $r->recordHistory = true;
 $r->send();
 $r->setOptions(array('encodecookies' => false));
@@ -23,7 +23,7 @@ echo "Done\n";
 ?>
 --EXPECTF--
 %sTEST
-GET /.print_request.php HTTP/1.1
+GET /ext-http/.print_request.php HTTP/1.1
 User-Agent: %s
 Host: dev.iworks.at
 Accept: */*
@@ -36,7 +36,7 @@ Array
     [name] => val=ue
 )
 
-GET /.print_request.php HTTP/1.1
+GET /ext-http/.print_request.php HTTP/1.1
 User-Agent: %s
 Host: dev.iworks.at
 Accept: */*
index 6f78eda51a9f228da32ae27ef3ee047ea7627ab5..4493d8c1750627ca69830fffbcc6909b0b7bb722 100644 (file)
@@ -10,7 +10,7 @@ skipif(!http_support(HTTP_SUPPORT_REQUESTS), 'need curl support');
 <?php
 echo "-TEST\n";
 
-var_dump(http_parse_message(http_get('http://dev.iworks.at/.print_request.php?gzip=1', array('compress' => true))));
+var_dump(http_parse_message(http_get('http://dev.iworks.at/ext-http/.print_request.php?gzip=1', array('compress' => true))));
 
 echo "Done\n";
 --EXPECTF--
index b8a5a3c1e2ea0f3552645228c5190c174337ff76..be90a82d780c081354d994d1bd4c9931119363d5 100644 (file)
@@ -9,7 +9,7 @@ skipif(!http_support(HTTP_SUPPORT_REQUESTS), "need request support");
 <?php
 echo "-TEST\n";
 
-var_dump(str_repeat("abc", 6000) === http_parse_message(http_put_data("http://dev.iworks.at/.print_put.php5", str_repeat("abc", 6000/* > CURLBUF_SIZE */)))->body);
+var_dump(str_repeat("abc", 6000) === http_parse_message(http_put_data("http://dev.iworks.at/ext-http/.print_put.php5", str_repeat("abc", 6000/* > CURLBUF_SIZE */)))->body);
 
 echo "Done\n";
 ?>