1
0
mirror of https://github.com/php/php-src.git synced 2026-04-13 11:02:55 +02:00
Files
archived-php-src/ext/curl/tests/curl_multi_getcontent_basic3.phpt
Peter Kokot d6c05c6cd1 Rename two *.php files in tests folders
Current run-tests.php script produces the `*.php` files from the
*.phpt. So all *.php files in tests folders are ignored by Git.

To avoid confusion and to for bettere consistency this patch renames
two remaining tests/*/*.php files to *.inc and *.phar as current
practice in *.phpt files.

- The `ext/curl/tests/resonder/get.php` to .inc extension
- The `ext/phar/tests/files/pear2coverage.phar.php` to .phar extension
2018-10-20 10:11:29 +02:00

59 lines
1.2 KiB
PHP

--TEST--
Curl_multi_getcontent() basic test with different sources (local file/http)
--CREDITS--
Rein Velt (rein@velt.org)
#TestFest Utrecht 20090509
--SKIPIF--
<?php include 'skipif.inc'; ?>
--FILE--
<?php
//CURL_MULTI_GETCONTENT TEST
//CREATE RESOURCES
$ch1=curl_init();
$ch2=curl_init();
//SET URL AND OTHER OPTIONS
include 'server.inc';
$host = curl_cli_server_start();
curl_setopt($ch1, CURLOPT_URL, "{$host}/get.inc?test=getpost&get_param=Hello%20World");
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();
//ADD THE 2 HANDLES
curl_multi_add_handle($mh,$ch1);
curl_multi_add_handle($mh,$ch2);
//EXECUTE
$running=0;
do {
curl_multi_exec($mh,$running);
} while ($running>0);
$results1=curl_multi_getcontent($ch1);
$results2=curl_multi_getcontent($ch2);
//CLOSE
curl_multi_remove_handle($mh,$ch1);
curl_multi_remove_handle($mh,$ch2);
curl_multi_close($mh);
echo $results1;
echo $results2;
?>
--EXPECT--
array(2) {
["test"]=>
string(7) "getpost"
["get_param"]=>
string(11) "Hello World"
}
array(0) {
}
CURL2