Annotation of embedaddon/php/ext/curl/tests/curl_setopt_basic003.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: curl_setopt() call with CURLOPT_HTTPHEADER
                      3: --CREDITS--
                      4: Paul Sohier
                      5: #phptestfest utrecht
                      6: --SKIPIF--
                      7: <?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
                      8: --FILE--
                      9: <?php
                     10: 
                     11: $host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
                     12: 
                     13: // start testing
                     14: echo "*** curl_setopt() call with CURLOPT_HTTPHEADER\n";
                     15: 
                     16: $url = "{$host}/";
                     17: $ch = curl_init();
                     18: 
                     19: curl_setopt($ch, CURLOPT_HTTPHEADER, 1);
                     20: 
                     21: $curl_content = curl_exec($ch);
                     22: curl_close($ch);
                     23: 
                     24: var_dump( $curl_content );
                     25: 
                     26: $ch = curl_init();
                     27: 
                     28: ob_start(); // start output buffering
                     29: curl_setopt($ch, CURLOPT_HTTPHEADER, array());
                     30: curl_setopt($ch, CURLOPT_URL, $host);
                     31: 
                     32: $curl_content = curl_exec($ch);
                     33: ob_end_clean();
                     34: curl_close($ch);
                     35: 
                     36: var_dump( $curl_content );
                     37: ?>
                     38: --EXPECTF--
                     39: *** curl_setopt() call with CURLOPT_HTTPHEADER
                     40: 
                     41: 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
                     42: bool(false)
                     43: bool(true)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>