summaryrefslogtreecommitdiff
path: root/ext/curl/tests/curl_setopt_basic003.phpt
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2010-01-07 13:31:53 +0100
committerOndřej Surý <ondrej@sury.org>2010-01-07 13:31:53 +0100
commit0fab6db7cac8d2be99579dd049f812a8ff98e74f (patch)
tree91f01b0d06916c78262404096bfd466b8e95e5b5 /ext/curl/tests/curl_setopt_basic003.phpt
parentd3a8757891280dc6650ca7eead67830c794b0e7b (diff)
downloadphp-upstream/5.3.1.tar.gz
Imported Upstream version 5.3.1upstream/5.3.1
Diffstat (limited to 'ext/curl/tests/curl_setopt_basic003.phpt')
-rw-r--r--ext/curl/tests/curl_setopt_basic003.phpt43
1 files changed, 43 insertions, 0 deletions
diff --git a/ext/curl/tests/curl_setopt_basic003.phpt b/ext/curl/tests/curl_setopt_basic003.phpt
new file mode 100644
index 000000000..47ae0f773
--- /dev/null
+++ b/ext/curl/tests/curl_setopt_basic003.phpt
@@ -0,0 +1,43 @@
+--TEST--
+curl_setopt() call with CURLOPT_HTTPHEADER
+--CREDITS--
+Paul Sohier
+#phptestfest utrecht
+--SKIPIF--
+<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
+--FILE--
+<?php
+
+$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
+
+// start testing
+echo "*** curl_setopt() call with CURLOPT_HTTPHEADER\n";
+
+$url = "{$host}/";
+$ch = curl_init();
+
+curl_setopt($ch, CURLOPT_HTTPHEADER, 1);
+
+$curl_content = curl_exec($ch);
+curl_close($ch);
+
+var_dump( $curl_content );
+
+$ch = curl_init();
+
+ob_start(); // start output buffering
+curl_setopt($ch, CURLOPT_HTTPHEADER, array());
+curl_setopt($ch, CURLOPT_URL, $host);
+
+$curl_content = curl_exec($ch);
+ob_end_clean();
+curl_close($ch);
+
+var_dump( $curl_content );
+?>
+--EXPECTF--
+*** curl_setopt() call with CURLOPT_HTTPHEADER
+
+Warning: curl_setopt(): You must pass either an object or an array with the CURLOPT_HTTPHEADER, CURLOPT_QUOTE, CURLOPT_HTTP200ALIASES and CURLOPT_POSTQUOTE arguments in %s on line %d
+bool(false)
+bool(true)