jani Sat, 25 Jul 2009 14:49:17 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=286304
Log: - Fix test when responder is something like lighttpd Changed paths: U php/php-src/branches/PHP_5_2/ext/curl/tests/curl_CURLOPT_READDATA.phpt U php/php-src/branches/PHP_5_3/ext/curl/tests/curl_CURLOPT_READDATA.phpt U php/php-src/trunk/ext/curl/tests/curl_CURLOPT_READDATA.phpt Modified: php/php-src/branches/PHP_5_2/ext/curl/tests/curl_CURLOPT_READDATA.phpt =================================================================== --- php/php-src/branches/PHP_5_2/ext/curl/tests/curl_CURLOPT_READDATA.phpt 2009-07-25 14:42:05 UTC (rev 286303) +++ php/php-src/branches/PHP_5_2/ext/curl/tests/curl_CURLOPT_READDATA.phpt 2009-07-25 14:49:17 UTC (rev 286304) @@ -4,16 +4,16 @@ Mattijs Hoitink mattijshoit...@gmail.com #Testfest Utrecht 2009 --SKIPIF-- -<?php if (!extension_loaded("curl") || empty($_ENV['PHP_CURL_HTTP_REMOTE_SERVER'])) print "skip"; ?> +<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER'])) print "skip"; ?> --FILE-- <?php // The URL to POST to -$url = $_ENV['PHP_CURL_HTTP_REMOTE_SERVER'] . '/get.php?test=post'; +$url = getenv('PHP_CURL_HTTP_REMOTE_SERVER') . '/get.php?test=post'; // Create a temporary file to read the data from $tempname = tempnam(sys_get_temp_dir(), 'CURL_DATA'); -file_put_contents($tempname, "hello=world&smurf=blue"); +$datalen = file_put_contents($tempname, "hello=world&smurf=blue"); ob_start(); @@ -22,7 +22,7 @@ curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_READDATA, fopen($tempname, 'rb')); -curl_setopt($ch, CURLOPT_HTTPHEADER, array('Transfer-Encoding: chunked')); +curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:', "Content-Length: {$datalen}")); if (false === $response = curl_exec($ch)) { echo 'Error #' . curl_errno($ch) . ': ' . curl_error($ch); Modified: php/php-src/branches/PHP_5_3/ext/curl/tests/curl_CURLOPT_READDATA.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/curl/tests/curl_CURLOPT_READDATA.phpt 2009-07-25 14:42:05 UTC (rev 286303) +++ php/php-src/branches/PHP_5_3/ext/curl/tests/curl_CURLOPT_READDATA.phpt 2009-07-25 14:49:17 UTC (rev 286304) @@ -4,16 +4,16 @@ Mattijs Hoitink mattijshoit...@gmail.com #Testfest Utrecht 2009 --SKIPIF-- -<?php if (!extension_loaded("curl") || empty($_ENV['PHP_CURL_HTTP_REMOTE_SERVER'])) print "skip"; ?> +<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER'])) print "skip"; ?> --FILE-- <?php // The URL to POST to -$url = $_ENV['PHP_CURL_HTTP_REMOTE_SERVER'] . '/get.php?test=post'; +$url = getenv('PHP_CURL_HTTP_REMOTE_SERVER') . '/get.php?test=post'; // Create a temporary file to read the data from $tempname = tempnam(sys_get_temp_dir(), 'CURL_DATA'); -file_put_contents($tempname, "hello=world&smurf=blue"); +$datalen = file_put_contents($tempname, "hello=world&smurf=blue"); ob_start(); @@ -22,7 +22,7 @@ curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_READDATA, fopen($tempname, 'rb')); -curl_setopt($ch, CURLOPT_HTTPHEADER, array('Transfer-Encoding: chunked')); +curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:', "Content-Length: {$datalen}")); if (false === $response = curl_exec($ch)) { echo 'Error #' . curl_errno($ch) . ': ' . curl_error($ch); Modified: php/php-src/trunk/ext/curl/tests/curl_CURLOPT_READDATA.phpt =================================================================== --- php/php-src/trunk/ext/curl/tests/curl_CURLOPT_READDATA.phpt 2009-07-25 14:42:05 UTC (rev 286303) +++ php/php-src/trunk/ext/curl/tests/curl_CURLOPT_READDATA.phpt 2009-07-25 14:49:17 UTC (rev 286304) @@ -4,16 +4,16 @@ Mattijs Hoitink mattijshoit...@gmail.com #Testfest Utrecht 2009 --SKIPIF-- -<?php if (!extension_loaded("curl") || empty($_ENV['PHP_CURL_HTTP_REMOTE_SERVER'])) print "skip"; ?> +<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER'])) print "skip"; ?> --FILE-- <?php // The URL to POST to -$url = $_ENV['PHP_CURL_HTTP_REMOTE_SERVER'] . '/get.php?test=post'; +$url = getenv('PHP_CURL_HTTP_REMOTE_SERVER') . '/get.php?test=post'; // Create a temporary file to read the data from $tempname = tempnam(sys_get_temp_dir(), 'CURL_DATA'); -file_put_contents($tempname, "hello=world&smurf=blue"); +$datalen = file_put_contents($tempname, "hello=world&smurf=blue"); ob_start(); @@ -22,7 +22,7 @@ curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_READDATA, fopen($tempname, 'rb')); -curl_setopt($ch, CURLOPT_HTTPHEADER, array('Transfer-Encoding: chunked')); +curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:', "Content-Length: {$datalen}")); if (false === $response = curl_exec($ch)) { echo 'Error #' . curl_errno($ch) . ': ' . curl_error($ch);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php