diff options
| author | Ondřej Surý <ondrej@sury.org> | 2010-01-07 13:31:53 +0100 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2010-01-07 13:31:53 +0100 |
| commit | 0fab6db7cac8d2be99579dd049f812a8ff98e74f (patch) | |
| tree | 91f01b0d06916c78262404096bfd466b8e95e5b5 /ext/curl/tests/curl_multi_getcontent_basic3.phpt | |
| parent | d3a8757891280dc6650ca7eead67830c794b0e7b (diff) | |
| download | php-upstream/5.3.1.tar.gz | |
Imported Upstream version 5.3.1upstream/5.3.1
Diffstat (limited to 'ext/curl/tests/curl_multi_getcontent_basic3.phpt')
| -rw-r--r-- | ext/curl/tests/curl_multi_getcontent_basic3.phpt | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/ext/curl/tests/curl_multi_getcontent_basic3.phpt b/ext/curl/tests/curl_multi_getcontent_basic3.phpt new file mode 100644 index 000000000..1434c58d0 --- /dev/null +++ b/ext/curl/tests/curl_multi_getcontent_basic3.phpt @@ -0,0 +1,59 @@ +--TEST-- +Curl_multi_getcontent() basic test with different sources (local file/http) +--CREDITS-- +Rein Velt (rein@velt.org) +#TestFest Utrecht 20090509 +--SKIPIF-- +<?php +if (!extension_loaded('curl')) print 'skip'; +?> +--FILE-- +<?php + //CURL_MULTI_GETCONTENT TEST + + //CREATE RESOURCES + $ch1=curl_init(); + $ch2=curl_init(); + + //SET URL AND OTHER OPTIONS + curl_setopt($ch1, CURLOPT_URL, "http://php.net/robots.txt"); + curl_setopt($ch2, CURLOPT_URL, "file://".dirname(__FILE__)."/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-- +User-agent: * +Disallow: /backend/ +Disallow: /distributions/ +Disallow: /stats/ +Disallow: /source.php +Disallow: /search.php +Disallow: /mod.php +Disallow: /manual/add-note.php +CURL2 + |
