- 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 d1b18e8..cdbdc36 100644 (file)
@@ -3,6 +3,7 @@ HttpRequestDataShare
 --SKIPIF--
 <?php
 include "skip.inc";
+checkurl("www.google.com");
 checkcls("HttpRequestDataShare");
 ?>
 --FILE--
index 1c7aa6f..4c61a79 100644 (file)
@@ -3,6 +3,7 @@ HttpRequestDataShare global
 --SKIPIF--
 <?php
 include "skip.inc";
+checkurl("www.google.com");
 checkcls("HttpRequestDataShare");
 ?>
 --FILE--
index 1cfcfc8..4008e50 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 e15a756..94fd2c5 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 a51f00b..5710d59 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 4c253e0..dd710f0 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 68c3ffe..24ee8a1 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 1f31404..f440c83 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 7b32439..638d4c8 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 ead16d8..e74121a 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 13acd5f..10ec767 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 38428f3..8488b9d 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 6f78eda..4493d8c 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 b8a5a3c..be90a82 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";
 ?>