mirror of
https://github.com/php/php-src.git
synced 2024-09-27 12:57:26 +00:00
- Nuke duplicate tests
This commit is contained in:
parent
2e1b73d221
commit
84bf8253b1
@ -1,41 +0,0 @@
|
||||
--TEST--
|
||||
Test curl_exec() function with basic functionality
|
||||
--CREDITS--
|
||||
Sebastian Deutsch <sebastian.deutsch@9elements.com>
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : bool curl_exec(resource ch)
|
||||
* Description: Perform a cURL session
|
||||
* Source code: ext/curl/interface.c
|
||||
* Alias to functions:
|
||||
*/
|
||||
|
||||
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
|
||||
// start testing
|
||||
echo "*** Testing curl_exec() : basic functionality ***\n";
|
||||
|
||||
$url = "{$host}/get.php?test=get";
|
||||
$ch = curl_init();
|
||||
|
||||
ob_start(); // start output buffering
|
||||
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
|
||||
$ok = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
$curl_content = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
if($ok) {
|
||||
var_dump( $curl_content );
|
||||
} else {
|
||||
echo "curl_exec returned false";
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing curl_exec() : basic functionality ***
|
||||
string(25) "Hello World!
|
||||
Hello World!"
|
||||
===DONE===
|
@ -1,37 +0,0 @@
|
||||
--TEST--
|
||||
Test curl_opt() function with CURLOPT_RETURNTRANSFER parameter set to 1
|
||||
--CREDITS--
|
||||
Sebastian Deutsch <sebastian.deutsch@9elements.com>
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : bool curl_setopt(resource ch, int option, mixed value)
|
||||
* Description: Set an option for a cURL transfer
|
||||
* Source code: ext/curl/interface.c
|
||||
* Alias to functions:
|
||||
*/
|
||||
|
||||
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
|
||||
// start testing
|
||||
echo '*** Testing curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); ***' . "\n";
|
||||
|
||||
$url = "{$host}/get.php?test=get";
|
||||
$ch = curl_init();
|
||||
|
||||
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);
|
||||
|
||||
var_dump( $curl_content );
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); ***
|
||||
string(25) "Hello World!
|
||||
Hello World!"
|
||||
===DONE===
|
@ -1,52 +0,0 @@
|
||||
--TEST--
|
||||
Test curl_opt() function with POST parameters
|
||||
--CREDITS--
|
||||
Sebastian Deutsch <sebastian.deutsch@9elements.com>
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : bool curl_setopt(resource ch, int option, mixed value)
|
||||
* Description: Set an option for a cURL transfer
|
||||
* Source code: ext/curl/interface.c
|
||||
* Alias to functions:
|
||||
*/
|
||||
|
||||
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
|
||||
// start testing
|
||||
echo '*** Testing curl sending through GET an POST ***' . "\n";
|
||||
|
||||
$url = "{$host}/get.php?test=getpost&get_param=Hello%20World";
|
||||
$ch = curl_init();
|
||||
|
||||
ob_start(); // start output buffering
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
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);
|
||||
|
||||
var_dump( $curl_content );
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing curl sending through GET an POST ***
|
||||
string(208) "array(2) {
|
||||
["test"]=>
|
||||
string(7) "getpost"
|
||||
["get_param"]=>
|
||||
string(11) "Hello World"
|
||||
}
|
||||
array(3) {
|
||||
["Hello"]=>
|
||||
string(5) "World"
|
||||
["Foo"]=>
|
||||
string(3) "Bar"
|
||||
["Person"]=>
|
||||
string(8) "John Doe"
|
||||
}
|
||||
"
|
||||
===DONE===
|
@ -1,37 +0,0 @@
|
||||
--TEST--
|
||||
Test curl_opt() function with setting referer
|
||||
--CREDITS--
|
||||
Sebastian Deutsch <sebastian.deutsch@9elements.com>
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : bool curl_setopt(resource ch, int option, mixed value)
|
||||
* Description: Set an option for a cURL transfer
|
||||
* Source code: ext/curl/interface.c
|
||||
* Alias to functions:
|
||||
*/
|
||||
|
||||
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
|
||||
// start testing
|
||||
echo '*** Testing curl setting referer ***' . "\n";
|
||||
|
||||
$url = "{$host}/get.php?test=referer";
|
||||
$ch = curl_init();
|
||||
|
||||
ob_start(); // start output buffering
|
||||
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);
|
||||
|
||||
var_dump( $curl_content );
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing curl setting referer ***
|
||||
string(19) "http://www.refer.er"
|
||||
===DONE===
|
@ -1,37 +0,0 @@
|
||||
--TEST--
|
||||
Test curl_opt() function with user agent
|
||||
--CREDITS--
|
||||
Sebastian Deutsch <sebastian.deutsch@9elements.com>
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : bool curl_setopt(resource ch, int option, mixed value)
|
||||
* Description: Set an option for a cURL transfer
|
||||
* Source code: ext/curl/interface.c
|
||||
* Alias to functions:
|
||||
*/
|
||||
|
||||
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
|
||||
// start testing
|
||||
echo '*** Testing curl with user agent ***' . "\n";
|
||||
|
||||
$url = "{$host}/get.php?test=useragent";
|
||||
$ch = curl_init();
|
||||
|
||||
ob_start(); // start output buffering
|
||||
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);
|
||||
|
||||
var_dump( $curl_content );
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing curl with user agent ***
|
||||
string(9) "cURL phpt"
|
||||
===DONE===
|
@ -1,35 +0,0 @@
|
||||
--TEST--
|
||||
Test curl_opt() function with CURLOPT_WRITEFUNCTION parameter set to a closure
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv(b'PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : bool curl_setopt(resource ch, int option, mixed value)
|
||||
* Description: Set an option for a cURL transfer
|
||||
* Source code: ext/curl/interface.c
|
||||
* Alias to functions:
|
||||
*/
|
||||
|
||||
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
|
||||
// start testing
|
||||
echo '*** Testing curl_setopt($ch, CURLOPT_WRITEFUNCTION, <closure>); ***' . "\n";
|
||||
|
||||
$url = "{$host}/get.php?test=get";
|
||||
$ch = curl_init();
|
||||
|
||||
ob_start(); // start output buffering
|
||||
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
|
||||
curl_setopt($ch, CURLOPT_WRITEFUNCTION, function ($ch, $data) {
|
||||
echo 'Data: '.$data;
|
||||
return strlen ($data);
|
||||
});
|
||||
|
||||
curl_exec($ch);
|
||||
curl_close($ch);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing curl_setopt($ch, CURLOPT_WRITEFUNCTION, <closure>); ***
|
||||
Data: Hello World!
|
||||
Hello World!===DONE===
|
Loading…
Reference in New Issue
Block a user