Fix cURL tests by implementing server script
Many cURL extension tests require an HTTP server to be running with a specific PHP file available. Travis will now run this script using the built-in HHVM web server. I've add skip files so if the user doesn't have the required environment variable set it will skip the tests, just like PHP does. Closes #1487 Reviewed By: @ptarjan Differential Revision: D1117179 Pulled By: @scannell
Esse commit está contido em:
+4
-3
@@ -3,11 +3,12 @@ language: cpp
|
||||
compiler:
|
||||
- gcc
|
||||
|
||||
before_script:
|
||||
before_script:
|
||||
- time TRAVIS=1 ./configure_ubuntu_12.04.sh
|
||||
# for some tests
|
||||
# for some tests
|
||||
- time sudo locale-gen de_DE && sudo locale-gen zh_CN.utf8 && sudo locale-gen fr_FR
|
||||
- time HPHP_HOME=`pwd` make -j 6
|
||||
- cd hphp/test/zend/good/ext/curl/tests/responder && ../../../../../../../hhvm/hhvm -m server -p 8444 &
|
||||
# mysql configuration for unit-tests
|
||||
- mysql -e 'CREATE DATABASE IF NOT EXISTS hhvm;'
|
||||
- export PDO_MYSQL_TEST_DSN="mysql:host=127.0.0.1;dbname=hhvm"
|
||||
@@ -40,7 +41,7 @@ env:
|
||||
- TEST_RUN_MODE="-m interp -r zend -I /^hphp\/test\/zend\/good\/(ext\/[a-ru-zA-Z0-9]|[Z]).*/"
|
||||
- TEST_RUN_MODE="-m interp -r zend -E /^hphp\/test\/zend\/good\/(ext\/[a-ru-zA-Z0-9]|[Z]).*/"
|
||||
|
||||
script: time hphp/hhvm/hhvm hphp/test/run $TEST_RUN_MODE
|
||||
script: time PHP_CURL_HTTP_REMOTE_SERVER="http://localhost:8444" hphp/hhvm/hhvm hphp/test/run $TEST_RUN_MODE
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
@@ -27,7 +27,11 @@ namespace HPHP {
|
||||
|
||||
Variant f_simplexml_import_dom(CObjRef node,
|
||||
const String& class_name = "SimpleXMLElement");
|
||||
Variant f_simplexml_load_string(const String& data, const String& class_name = "SimpleXMLElement", int64_t options = 0, const String& ns = "", bool is_prefix = false);
|
||||
Variant f_simplexml_load_string(const String& data,
|
||||
const String& class_name = "SimpleXMLElement",
|
||||
int64_t options = 0,
|
||||
const String& ns = "",
|
||||
bool is_prefix = false);
|
||||
Variant f_simplexml_load_file(const String& filename, const String& class_name = "SimpleXMLElement", int64_t options = 0, const String& ns = "", bool is_prefix = false);
|
||||
Variant f_libxml_get_errors();
|
||||
Variant f_libxml_get_last_error();
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, array('Hello'=>'World','Foo'=>'Bar',100=>'John Doe'));
|
||||
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
|
||||
|
||||
|
||||
$curl_content = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/* Prototype : bool curl_exec(resource ch)
|
||||
* Description: Perform a cURL session
|
||||
* Description: Perform a cURL session
|
||||
* Source code: ext/curl/interface.c
|
||||
* Alias to functions:
|
||||
* Alias to functions:
|
||||
*/
|
||||
|
||||
|
||||
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
|
||||
// start testing
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
ob_start(); // start output buffering
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
|
||||
|
||||
|
||||
$curl_content = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
+1
-1
@@ -18,7 +18,7 @@
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, "Hello=World&Foo=Bar&Person=John%20Doe");
|
||||
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
|
||||
|
||||
|
||||
$curl_content = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_REFERER, 'http://www.refer.er');
|
||||
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
|
||||
|
||||
|
||||
$curl_content = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, 'cURL phpt');
|
||||
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
|
||||
|
||||
|
||||
$curl_content = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
echo 'Data: '.$data;
|
||||
return strlen ($data);
|
||||
});
|
||||
|
||||
|
||||
curl_exec($ch);
|
||||
curl_close($ch);
|
||||
?>
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
@@ -1 +1,2 @@
|
||||
<?php if (!extension_loaded("curl")) print "skip"; ?>
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
<?php if (!extension_loaded("curl")) print "skip"; ?>
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
|
||||
+2
-2
@@ -15,9 +15,9 @@
|
||||
|
||||
ob_start(); // start output buffering
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_COOKIE, 'foo=bar');
|
||||
curl_setopt($ch, CURLOPT_COOKIE, 'foo=bar');
|
||||
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
|
||||
|
||||
|
||||
$curl_content = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
|
||||
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
|
||||
|
||||
|
||||
$curl_content = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
|
||||
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
|
||||
|
||||
|
||||
$curl_content = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
@@ -1 +1,2 @@
|
||||
<?php if (!extension_loaded("curl")) exit("skip curl extension not loaded"); ?>
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
|
||||
+10
-10
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/* Prototype : bool curl_multi_exec(resource ch)
|
||||
* Description: Perform a cURL session
|
||||
* Description: Perform a cURL session
|
||||
* Source code: ext/curl/multi.c
|
||||
* Alias to functions:
|
||||
* Alias to functions:
|
||||
*/
|
||||
|
||||
|
||||
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
|
||||
// start testing
|
||||
@@ -16,33 +16,33 @@
|
||||
1 => curl_init(),
|
||||
2 => curl_init(),
|
||||
);
|
||||
|
||||
|
||||
ob_start(); // start output buffering
|
||||
|
||||
|
||||
curl_setopt($chs[0], CURLOPT_URL, $url); //set the url we want to use
|
||||
curl_setopt($chs[1], CURLOPT_URL, $url); //set the url we want to use
|
||||
curl_setopt($chs[2], CURLOPT_URL, $url); //set the url we want to use
|
||||
|
||||
|
||||
$mh = curl_multi_init();
|
||||
|
||||
|
||||
// add handlers
|
||||
curl_multi_add_handle($mh, $chs[0]);
|
||||
curl_multi_add_handle($mh, $chs[1]);
|
||||
curl_multi_add_handle($mh, $chs[2]);
|
||||
|
||||
|
||||
$running=null;
|
||||
//execute the handles
|
||||
$state = null;
|
||||
do {
|
||||
$state = curl_multi_exec($mh, $running);
|
||||
} while ($running > 0);
|
||||
|
||||
|
||||
//close the handles
|
||||
curl_multi_remove_handle($mh, $chs[0]);
|
||||
curl_multi_remove_handle($mh, $chs[1]);
|
||||
curl_multi_remove_handle($mh, $chs[2]);
|
||||
curl_multi_close($mh);
|
||||
|
||||
|
||||
$curl_content = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
+10
-10
@@ -4,7 +4,7 @@
|
||||
* Source code: ext/curl/interface.c
|
||||
* Alias to functions:
|
||||
*/
|
||||
|
||||
|
||||
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
|
||||
// start testing
|
||||
@@ -16,25 +16,25 @@
|
||||
1 => curl_init(),
|
||||
2 => curl_init(),
|
||||
);
|
||||
|
||||
|
||||
ob_start(); // start output buffering
|
||||
|
||||
|
||||
$options = array(
|
||||
CURLOPT_RETURNTRANSFER => 1,
|
||||
CURLOPT_URL => $url,
|
||||
);
|
||||
|
||||
|
||||
curl_setopt_array($chs[0], $options); //set the options
|
||||
curl_setopt_array($chs[1], $options); //set the options
|
||||
curl_setopt_array($chs[2], $options); //set the options
|
||||
|
||||
|
||||
$mh = curl_multi_init();
|
||||
|
||||
|
||||
// add handlers
|
||||
curl_multi_add_handle($mh, $chs[0]);
|
||||
curl_multi_add_handle($mh, $chs[1]);
|
||||
curl_multi_add_handle($mh, $chs[2]);
|
||||
|
||||
|
||||
$running=null;
|
||||
//execute the handles
|
||||
do {
|
||||
@@ -45,14 +45,14 @@
|
||||
$curl_content .= curl_multi_getcontent($chs[0]);
|
||||
$curl_content .= curl_multi_getcontent($chs[1]);
|
||||
$curl_content .= curl_multi_getcontent($chs[2]);
|
||||
|
||||
|
||||
//close the handles
|
||||
curl_multi_remove_handle($mh, $chs[0]);
|
||||
curl_multi_remove_handle($mh, $chs[1]);
|
||||
curl_multi_remove_handle($mh, $chs[2]);
|
||||
curl_multi_close($mh);
|
||||
|
||||
|
||||
var_dump( $curl_content );
|
||||
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
curl_exec($ch);
|
||||
$info = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
|
||||
var_dump($url == $info);
|
||||
|
||||
|
||||
curl_close($ch);
|
||||
?>
|
||||
===DONE===
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
+2
-2
@@ -10,10 +10,10 @@
|
||||
ob_start(); // start output buffering
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
|
||||
|
||||
|
||||
$copy = curl_copy_handle($ch);
|
||||
curl_close($ch);
|
||||
|
||||
|
||||
$curl_content = curl_exec($copy);
|
||||
curl_close($copy);
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
+4
-4
@@ -10,13 +10,13 @@
|
||||
ob_start(); // start output buffering
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
|
||||
|
||||
|
||||
|
||||
|
||||
$curl_content = curl_exec($ch);
|
||||
$copy = curl_copy_handle($ch);
|
||||
curl_close($ch);
|
||||
|
||||
$curl_content_copy = curl_exec($copy);
|
||||
|
||||
$curl_content_copy = curl_exec($copy);
|
||||
curl_close($copy);
|
||||
|
||||
var_dump( $curl_content_copy );
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, 'cURL phpt');
|
||||
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
|
||||
|
||||
|
||||
$copy = curl_copy_handle($ch);
|
||||
|
||||
var_dump( curl_exec($ch) );
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
+2
-2
@@ -12,10 +12,10 @@
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, array("Hello" => "World", "Foo" => "Bar", "Person" => "John Doe"));
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:')); // Disable Expect: header (lighttpd does not support it :)
|
||||
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
|
||||
|
||||
|
||||
$copy = curl_copy_handle($ch);
|
||||
curl_close($ch);
|
||||
|
||||
|
||||
$curl_content = curl_exec($copy);
|
||||
curl_close($copy);
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
+4
-4
@@ -2,7 +2,7 @@
|
||||
//CURL_MULTI_GETCONTENT TEST
|
||||
|
||||
//CREATE RESOURCES
|
||||
$ch1=curl_init();
|
||||
$ch1=curl_init();
|
||||
$ch2=curl_init();
|
||||
|
||||
//SET URL AND OTHER OPTIONS
|
||||
@@ -11,7 +11,7 @@
|
||||
curl_setopt($ch2, CURLOPT_URL, "file://".dirname(__FILE__). DIRECTORY_SEPARATOR . "curl_testdata2.txt");
|
||||
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
|
||||
//CREATE MULTIPLE CURL HANDLE
|
||||
$mh=curl_multi_init();
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
$results2=curl_multi_getcontent($ch2);
|
||||
|
||||
//CLOSE
|
||||
curl_multi_remove_handle($mh,$ch1);
|
||||
curl_multi_remove_handle($mh,$ch1);
|
||||
curl_multi_remove_handle($mh,$ch2);
|
||||
curl_multi_close($mh);
|
||||
curl_multi_close($mh);
|
||||
|
||||
echo $results1;
|
||||
echo $results2;
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
+5
-5
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
function custom_readfunction($oCurl, $hReadHandle, $iMaxOut)
|
||||
<?php
|
||||
function custom_readfunction($oCurl, $hReadHandle, $iMaxOut)
|
||||
{
|
||||
$sData = fread($hReadHandle,$iMaxOut-10); # -10 to have space to add "custom:"
|
||||
if (!empty($sData))
|
||||
{
|
||||
{
|
||||
$sData = "custom:".$sData;
|
||||
}
|
||||
return $sData;
|
||||
@@ -25,9 +25,9 @@ curl_setopt($oCurl, CURLOPT_INFILE, $hReadHandle );
|
||||
curl_exec($oCurl);
|
||||
curl_close($oCurl);
|
||||
|
||||
fclose ($hReadHandle);
|
||||
fclose ($hReadHandle);
|
||||
|
||||
$sOutput = file_get_contents($sWriteFile);
|
||||
$sOutput = file_get_contents($sWriteFile);
|
||||
var_dump($sOutput);
|
||||
?>
|
||||
===DONE===
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) print "skip cURL extension not loaded";
|
||||
<?php
|
||||
if (!extension_loaded("curl")) print "skip cURL extension not loaded";
|
||||
?>
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
$test = isset($_GET['test']) ? $_GET['test'] : null;
|
||||
switch($test) {
|
||||
case 'post':
|
||||
var_dump($_POST);
|
||||
break;
|
||||
case 'getpost':
|
||||
var_dump($_GET);
|
||||
var_dump($_POST);
|
||||
break;
|
||||
case 'referer':
|
||||
echo $_SERVER['HTTP_REFERER'];
|
||||
break;
|
||||
case 'useragent':
|
||||
echo $_SERVER['HTTP_USER_AGENT'];
|
||||
break;
|
||||
case 'httpversion':
|
||||
echo $_SERVER['SERVER_PROTOCOL'];
|
||||
break;
|
||||
case 'cookie':
|
||||
echo $_COOKIE['foo'];
|
||||
break;
|
||||
case 'encoding':
|
||||
echo $_SERVER['HTTP_ACCEPT_ENCODING'];
|
||||
break;
|
||||
case 'contenttype':
|
||||
header('Content-Type: text/plain;charset=utf-8');
|
||||
break;
|
||||
case 'file':
|
||||
if (isset($_FILES['file'])) {
|
||||
echo $_FILES['file']['name'] . '|' . $_FILES['file']['type'];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo "Hello World!\n";
|
||||
echo "Hello World!";
|
||||
break;
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1 @@
|
||||
always skip - not a test
|
||||
@@ -423,6 +423,7 @@ other_files = (
|
||||
'/ext/bz2/tests/004_1.txt.bz2',
|
||||
'/ext/bz2/tests/004_2.txt.bz2',
|
||||
'/ext/calendar/tests/skipif.inc',
|
||||
'/ext/curl/tests/responder/get.php',
|
||||
'/ext/curl/tests/curl_testdata1.txt',
|
||||
'/ext/curl/tests/curl_testdata2.txt',
|
||||
'/ext/date/tests/DateTime_data-absolute.inc',
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário