mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
Fix test to remove dependancy over php.net
This commit is contained in:
parent
fff23f12bd
commit
fe1bf12552
1 changed files with 14 additions and 17 deletions
|
@ -6,6 +6,9 @@ Rein Velt (rein@velt.org)
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php
|
<?php
|
||||||
if (!extension_loaded('curl')) print 'skip need ext/curl';
|
if (!extension_loaded('curl')) print 'skip need ext/curl';
|
||||||
|
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) {
|
||||||
|
exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
|
@ -16,7 +19,8 @@ if (!extension_loaded('curl')) print 'skip need ext/curl';
|
||||||
$ch2=curl_init();
|
$ch2=curl_init();
|
||||||
|
|
||||||
//SET URL AND OTHER OPTIONS
|
//SET URL AND OTHER OPTIONS
|
||||||
curl_setopt($ch1, CURLOPT_URL, "http://php.net/robots.txt");
|
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||||
|
curl_setopt($ch1, CURLOPT_URL, "{$host}/get.php?test=getpost&get_param=Hello%20World");
|
||||||
curl_setopt($ch2, CURLOPT_URL, "file://".dirname(__FILE__). DIRECTORY_SEPARATOR . "curl_testdata2.txt");
|
curl_setopt($ch2, CURLOPT_URL, "file://".dirname(__FILE__). DIRECTORY_SEPARATOR . "curl_testdata2.txt");
|
||||||
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
|
||||||
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
@ -46,20 +50,13 @@ if (!extension_loaded('curl')) print 'skip need ext/curl';
|
||||||
echo $results2;
|
echo $results2;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECTF--
|
||||||
User-agent: *
|
array(2) {
|
||||||
Disallow: /backend/
|
["test"]=>
|
||||||
Disallow: /distributions/
|
string(7) "getpost"
|
||||||
Disallow: /stats/
|
["get_param"]=>
|
||||||
Disallow: /server-status/
|
string(11) "Hello World"
|
||||||
Disallow: /source.php
|
}
|
||||||
Disallow: /search.php
|
array(0) {
|
||||||
Disallow: /mod.php
|
}
|
||||||
Disallow: /manual/add-note.php
|
|
||||||
|
|
||||||
Disallow: /harming/humans
|
|
||||||
Disallow: /ignoring/human/orders
|
|
||||||
Disallow: /harm/to/self
|
|
||||||
|
|
||||||
CURL2
|
CURL2
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue