pierrick Mon, 21 Nov 2011 02:10:57 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=319592
Log: Fix test to use PHP_CURL_HTTP_REMOTE_SERVER Changed paths: U php/php-src/branches/PHP_5_3/ext/curl/tests/bug54798.phpt U php/php-src/branches/PHP_5_4/ext/curl/tests/bug54798.phpt U php/php-src/trunk/ext/curl/tests/bug54798.phpt Modified: php/php-src/branches/PHP_5_3/ext/curl/tests/bug54798.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/curl/tests/bug54798.phpt 2011-11-21 02:03:20 UTC (rev 319591) +++ php/php-src/branches/PHP_5_3/ext/curl/tests/bug54798.phpt 2011-11-21 02:10:57 UTC (rev 319592) @@ -12,7 +12,7 @@ --FILE-- <?php -function checkForClosedFilePointer($curl_option, $description) { +function checkForClosedFilePointer($host, $curl_option, $description) { $fp = fopen(dirname(__FILE__) . '/bug54798.tmp', 'w+'); $ch = curl_init(); @@ -28,7 +28,7 @@ curl_setopt($ch, $curl_option, $fp); - curl_setopt($ch, CURLOPT_URL, 'localhost'); + curl_setopt($ch, CURLOPT_URL, $host); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); fclose($fp); // <-- premature close of $fp caused a crash! @@ -47,8 +47,9 @@ "CURLOPT_INFILE" ); +$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER'); foreach($options_to_check as $option) { - checkForClosedFilePointer(constant($option), $option); + checkForClosedFilePointer($host, constant($option), $option); } ?> Modified: php/php-src/branches/PHP_5_4/ext/curl/tests/bug54798.phpt =================================================================== --- php/php-src/branches/PHP_5_4/ext/curl/tests/bug54798.phpt 2011-11-21 02:03:20 UTC (rev 319591) +++ php/php-src/branches/PHP_5_4/ext/curl/tests/bug54798.phpt 2011-11-21 02:10:57 UTC (rev 319592) @@ -12,7 +12,7 @@ --FILE-- <?php -function checkForClosedFilePointer($curl_option, $description) { +function checkForClosedFilePointer($host, $curl_option, $description) { $fp = fopen(dirname(__FILE__) . '/bug54798.tmp', 'w+'); $ch = curl_init(); @@ -28,7 +28,7 @@ curl_setopt($ch, $curl_option, $fp); - curl_setopt($ch, CURLOPT_URL, 'localhost'); + curl_setopt($ch, CURLOPT_URL, $host); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); fclose($fp); // <-- premature close of $fp caused a crash! @@ -47,8 +47,9 @@ "CURLOPT_INFILE" ); +$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER'); foreach($options_to_check as $option) { - checkForClosedFilePointer(constant($option), $option); + checkForClosedFilePointer($host, constant($option), $option); } ?> Modified: php/php-src/trunk/ext/curl/tests/bug54798.phpt =================================================================== --- php/php-src/trunk/ext/curl/tests/bug54798.phpt 2011-11-21 02:03:20 UTC (rev 319591) +++ php/php-src/trunk/ext/curl/tests/bug54798.phpt 2011-11-21 02:10:57 UTC (rev 319592) @@ -12,7 +12,7 @@ --FILE-- <?php -function checkForClosedFilePointer($curl_option, $description) { +function checkForClosedFilePointer($host, $curl_option, $description) { $fp = fopen(dirname(__FILE__) . '/bug54798.tmp', 'w+'); $ch = curl_init(); @@ -28,7 +28,7 @@ curl_setopt($ch, $curl_option, $fp); - curl_setopt($ch, CURLOPT_URL, 'localhost'); + curl_setopt($ch, CURLOPT_URL, $host); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); fclose($fp); // <-- premature close of $fp caused a crash! @@ -47,8 +47,9 @@ "CURLOPT_INFILE" ); +$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER'); foreach($options_to_check as $option) { - checkForClosedFilePointer(constant($option), $option); + checkForClosedFilePointer($host, constant($option), $option); } ?>
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php