--- /dev/null
+--TEST--
+Test curl_exec() function with basic functionality
+--CREDITS--
+Sebastian Deutsch <sebastian.deutsch@9elements.com>
+TestFest 2009 - AFUP - Jean-Marc Fontaine <jmf@durcommefaire.net>
+--SKIPIF--
+<?php
+if (!extension_loaded("curl")) exit("skip curl extension not loaded");
+if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
+?>
+--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===
--- /dev/null
+--TEST--
+Test curl_opt() function with CURLOPT_RETURNTRANSFER parameter set to 1
+--CREDITS--
+Sebastian Deutsch <sebastian.deutsch@9elements.com>
+TestFest 2009 - AFUP - Jean-Marc Fontaine <jmf@durcommefaire.net>
+--SKIPIF--
+<?php
+if (!extension_loaded("curl")) exit("skip curl extension not loaded");
+if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
+?>
+--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===
--- /dev/null
+--TEST--
+Test curl_opt() function with POST parameters
+--CREDITS--
+Sebastian Deutsch <sebastian.deutsch@9elements.com>
+TestFest 2009 - AFUP - Jean-Marc Fontaine <jmf@durcommefaire.net>
+--SKIPIF--
+<?php
+if (!extension_loaded("curl")) exit("skip curl extension not loaded");
+if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
+?>
+--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===
--- /dev/null
+--TEST--
+Test curl_opt() function with setting referer
+--CREDITS--
+Sebastian Deutsch <sebastian.deutsch@9elements.com>
+TestFest 2009 - AFUP - Jean-Marc Fontaine <jmf@durcommefaire.net>
+--SKIPIF--
+<?php
+if (!extension_loaded("curl")) exit("skip curl extension not loaded");
+if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
+?>
+--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===
--- /dev/null
+--TEST--
+Test curl_opt() function with user agent
+--CREDITS--
+Sebastian Deutsch <sebastian.deutsch@9elements.com>
+TestFest 2009 - AFUP - Jean-Marc Fontaine <jmf@durcommefaire.net>
+--SKIPIF--
+<?php
+if (!extension_loaded("curl")) exit("skip curl extension not loaded");
+if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
+?>
+--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===
--- /dev/null
+--TEST--
+Test curl_error() & curl_errno() function without url
+--CREDITS--
+TestFest 2009 - AFUP - Perrick Penet <perrick@noparking.net>
+--SKIPIF--
+<?php if (!extension_loaded("curl")) print "skip"; ?>
+--FILE--
+<?php
+
+$ch = curl_init();
+
+curl_exec($ch);
+var_dump(curl_error($ch));
+var_dump(curl_errno($ch));
+curl_close($ch);
+
+
+?>
+--EXPECTF--
+%string|unicode%(11) "No URL set!"
+int(3)
--- /dev/null
+--TEST--
+Test curl_error() & curl_errno() function with problematic host
+--CREDITS--
+TestFest 2009 - AFUP - Perrick Penet <perrick@noparking.net>
+--SKIPIF--
+<?php if (!extension_loaded("curl")) print "skip"; ?>
+--FILE--
+<?php
+
+$url = "http://www.".uniqid().".".uniqid();
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, $url);
+
+curl_exec($ch);
+var_dump(curl_error($ch));
+var_dump(curl_errno($ch));
+curl_close($ch);
+
+
+?>
+--EXPECTF--
+%unicode|string%(55) "Couldn't resolve host 'www.%s.%s'"
+int(6)
--- /dev/null
+--TEST--
+Test curl_error() & curl_errno() function with problematic protocol
+--CREDITS--
+TestFest 2009 - AFUP - Perrick Penet <perrick@noparking.net>
+--SKIPIF--
+<?php if (!extension_loaded("curl")) print "skip"; ?>
+--FILE--
+<?php
+
+$url = uniqid()."://www.".uniqid().".".uniqid();
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, $url);
+
+curl_exec($ch);
+var_dump(curl_error($ch));
+var_dump(curl_errno($ch));
+curl_close($ch);
+
+
+?>
+--EXPECTF--
+%unicode|string%(%d) "%Srotocol%s"
+int(1)
--- /dev/null
+--TEST--
+Test curl_error() & curl_errno() function with problematic proxy
+--CREDITS--
+TestFest 2009 - AFUP - Perrick Penet <perrick@noparking.net>
+--SKIPIF--
+<?php if (!extension_loaded("curl")) print "skip"; ?>
+--FILE--
+<?php
+
+$url = "http://www.example.org";
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_PROXY, uniqid().":".uniqid());
+curl_setopt($ch, CURLOPT_URL, $url);
+
+curl_exec($ch);
+var_dump(curl_error($ch));
+var_dump(curl_errno($ch));
+curl_close($ch);
+
+
+?>
+--EXPECTF--
+%unicode|string%(38) "Couldn't resolve proxy '%s'"
+int(5)
--- /dev/null
+--TEST--
+Test curl_opt() function with COOKIE
+--CREDITS--
+TestFest 2009 - AFUP - Xavier Gorse <xgorse@elao.com>
+--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 with cookie ***' . "\n";
+
+ $url = "{$host}/get.php?test=cookie";
+ $ch = curl_init();
+
+ ob_start(); // start output buffering
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+ curl_setopt($ch, CURLOPT_COOKIE, 'foo=bar');
+ 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 cookie ***
+string(3) "bar"
+===DONE===
+
\ No newline at end of file
--- /dev/null
+--TEST--
+Test curl_opt() function with CURLOPT_HTTP_VERSION/CURL_HTTP_VERSION_1_0
+--CREDITS--
+TestFest 2009 - AFUP - Xavier Gorse <xgorse@elao.com>
+--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 with HTTP/1.0 ***' . "\n";
+
+ $url = "{$host}/get.php?test=httpversion";
+ $ch = curl_init();
+
+ ob_start(); // start output buffering
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+ curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
+ 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 HTTP/1.0 ***
+string(8) "HTTP/1.0"
+===DONE===
+
\ No newline at end of file
--- /dev/null
+--TEST--
+Test curl_opt() function with CURLOPT_HTTP_VERSION/CURL_HTTP_VERSION_1_1
+--CREDITS--
+TestFest 2009 - AFUP - Xavier Gorse <xgorse@elao.com>
+--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 with HTTP/1.1 ***' . "\n";
+
+ $url = "{$host}/get.php?test=httpversion";
+ $ch = curl_init();
+
+ ob_start(); // start output buffering
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+ curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_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 with HTTP/1.1 ***
+string(8) "HTTP/1.1"
+===DONE===
+
\ No newline at end of file
--- /dev/null
+--TEST--
+Test curl_init() function with basic functionality
+--CREDITS--
+Jean-Marc Fontaine <jmf@durcommefaire.net>
+--SKIPIF--
+<?php if (!extension_loaded("curl")) exit("skip curl extension not loaded"); ?>
+--FILE--
+<?php
+ $ch = curl_init();
+ var_dump($ch);
+?>
+===DONE===
+--EXPECTF--
+resource(%d) of type (curl)
+===DONE===
--- /dev/null
+--TEST--
+Test curl_init() function with $url parameter defined
+--CREDITS--
+Jean-Marc Fontaine <jmf@durcommefaire.net>
+--SKIPIF--
+<?php if (!extension_loaded("curl")) exit("skip curl extension not loaded"); ?>
+--FILE--
+<?php
+ $url = 'http://www.example.com/';
+ $ch = curl_init($url);
+ var_dump($url == curl_getinfo($ch, CURLINFO_EFFECTIVE_URL));
+?>
+===DONE===
+--EXPECTF--
+bool(true)
+===DONE===
--- /dev/null
+--TEST--
+Test curl_getinfo() function with basic functionality
+--CREDITS--
+Jean-Marc Fontaine <jmf@durcommefaire.net>
+--SKIPIF--
+<?php if (!extension_loaded("curl")) exit("skip curl extension not loaded"); ?>
+--FILE--
+<?php
+ $ch = curl_init();
+ $info = curl_getinfo($ch);
+ var_dump($info);
+?>
+===DONE===
+--EXPECTF--
+array(20) {
+ [%u|b%"url"]=>
+ string(0) ""
+ ["content_type"]=>
+ NULL
+ ["http_code"]=>
+ int(0)
+ ["header_size"]=>
+ int(0)
+ ["request_size"]=>
+ int(0)
+ ["filetime"]=>
+ int(0)
+ ["ssl_verify_result"]=>
+ int(0)
+ ["redirect_count"]=>
+ int(0)
+ ["total_time"]=>
+ float(0)
+ ["namelookup_time"]=>
+ float(0)
+ ["connect_time"]=>
+ float(0)
+ ["pretransfer_time"]=>
+ float(0)
+ ["size_upload"]=>
+ float(0)
+ ["size_download"]=>
+ float(0)
+ ["speed_download"]=>
+ float(0)
+ ["speed_upload"]=>
+ float(0)
+ ["download_content_length"]=>
+ float(0)
+ ["upload_content_length"]=>
+ float(0)
+ ["starttransfer_time"]=>
+ float(0)
+ ["redirect_time"]=>
+ float(0)
+}
+===DONE===
--- /dev/null
+--TEST--
+Test curl_multi_exec() function with basic functionality
+--CREDITS--
+TestFest 2009 - AFUP - Thomas Rabaix <thomas.rabaix@gmail.com>
+--SKIPIF--
+<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
+--FILE--
+<?php
+/* Prototype : bool curl_multi_exec(resource ch)
+ * Description: Perform a cURL session
+ * Source code: ext/curl/multi.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";
+ $chs = array(
+ 0 => curl_init(),
+ 1 => curl_init(),
+ 2 => curl_init(),
+ );
+
+ ob_start(); // start output buffering
+
+ curl_setopt($chs[0], CURLOPT_URL, $url); //set the url we want to use
+ curl_setopt($chs[1], CURLOPT_URL, $url); //set the url we want to use
+ curl_setopt($chs[2], CURLOPT_URL, $url); //set the url we want to use
+
+ $mh = curl_multi_init();
+
+ // add handlers
+ curl_multi_add_handle($mh, $chs[0]);
+ curl_multi_add_handle($mh, $chs[1]);
+ curl_multi_add_handle($mh, $chs[2]);
+
+ $running=null;
+ //execute the handles
+ $state = null;
+ do {
+ $state = curl_multi_exec($mh, $running);
+ } while ($running > 0);
+
+ //close the handles
+ curl_multi_remove_handle($mh, $chs[0]);
+ curl_multi_remove_handle($mh, $chs[1]);
+ curl_multi_remove_handle($mh, $chs[2]);
+ curl_multi_close($mh);
+
+ $curl_content = ob_get_contents();
+ ob_end_clean();
+
+ if($state === CURLM_OK) {
+ var_dump( $curl_content );
+ } else {
+ echo "curl_exec returned false";
+ }
+?>
+===DONE===
+--EXPECTF--
+*** Testing curl_exec() : basic functionality ***
+string(75) "Hello World!
+Hello World!Hello World!
+Hello World!Hello World!
+Hello World!"
+===DONE===
--- /dev/null
+--TEST--
+Test curl_setopt() with curl_multi function with basic functionality
+--CREDITS--
+TestFest 2009 - AFUP - Thomas Rabaix <thomas.rabaix@gmail.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_exec() : basic functionality ***\n";
+
+ $url = "{$host}/get.php?test=get";
+ $chs = array(
+ 0 => curl_init(),
+ 1 => curl_init(),
+ 2 => curl_init(),
+ );
+
+ ob_start(); // start output buffering
+
+ $options = array(
+ CURLOPT_RETURNTRANSFER => 1,
+ CURLOPT_URL => $url,
+ );
+
+ curl_setopt_array($chs[0], $options); //set the options
+ curl_setopt_array($chs[1], $options); //set the options
+ curl_setopt_array($chs[2], $options); //set the options
+
+ $mh = curl_multi_init();
+
+ // add handlers
+ curl_multi_add_handle($mh, $chs[0]);
+ curl_multi_add_handle($mh, $chs[1]);
+ curl_multi_add_handle($mh, $chs[2]);
+
+ $running=null;
+ //execute the handles
+ do {
+ curl_multi_exec($mh, $running);
+ } while ($running > 0);
+
+ $curl_content = '';
+ $curl_content .= curl_multi_getcontent($chs[0]);
+ $curl_content .= curl_multi_getcontent($chs[1]);
+ $curl_content .= curl_multi_getcontent($chs[2]);
+
+ //close the handles
+ curl_multi_remove_handle($mh, $chs[0]);
+ curl_multi_remove_handle($mh, $chs[1]);
+ curl_multi_remove_handle($mh, $chs[2]);
+ curl_multi_close($mh);
+
+ var_dump( $curl_content );
+
+?>
+===DONE===
+--EXPECTF--
+*** Testing curl_exec() : basic functionality ***
+%unicode|string%(75) "Hello World!
+Hello World!Hello World!
+Hello World!Hello World!
+Hello World!"
+===DONE===
--- /dev/null
+--TEST--
+Test curl_getinfo() function with CURLINFO_EFFECTIVE_URL parameter
+--CREDITS--
+Jean-Marc Fontaine <jmf@durcommefaire.net>
+--SKIPIF--
+<?php
+if (!extension_loaded("curl")) exit("skip curl extension not loaded");
+if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
+?>
+--FILE--
+<?php
+ $host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
+
+ $url = "{$host}/get.php?test=";
+ $ch = curl_init();
+
+ curl_setopt($ch, CURLOPT_URL, $url);
+ curl_exec($ch);
+ $info = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
+ var_dump($url == $info);
+
+ curl_close($ch);
+?>
+===DONE===
+--EXPECTF--
+Hello World!
+Hello World!bool(true)
+===DONE===
--- /dev/null
+--TEST--
+Test curl_getinfo() function with CURLINFO_HTTP_CODE parameter
+--CREDITS--
+Jean-Marc Fontaine <jmf@durcommefaire.net>
+--SKIPIF--
+<?php
+if (!extension_loaded("curl")) exit("skip curl extension not loaded");
+if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
+?>
+--FILE--
+<?php
+ $host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
+
+ $url = "{$host}/get.php?test=";
+ $ch = curl_init();
+ curl_setopt($ch, CURLOPT_URL, $url);
+ curl_exec($ch);
+ var_dump(curl_getinfo($ch, CURLINFO_HTTP_CODE));
+ curl_close($ch);
+?>
+===DONE===
+--EXPECTF--
+Hello World!
+Hello World!int(200)
+===DONE===
--- /dev/null
+--TEST--
+Test curl_getinfo() function with CURLINFO_CONTENT_TYPE parameter
+--CREDITS--
+Jean-Marc Fontaine <jmf@durcommefaire.net>
+--SKIPIF--
+<?php
+if (!extension_loaded("curl")) exit("skip curl extension not loaded");
+if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
+?>
+--FILE--
+<?php
+ $host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
+ $url = "{$host}/get.php?test=contenttype";
+
+ $ch = curl_init();
+ curl_setopt($ch, CURLOPT_URL, $url);
+ curl_exec($ch);
+ var_dump(curl_getinfo($ch, CURLINFO_CONTENT_TYPE));
+ curl_close($ch);
+?>
+===DONE===
+--EXPECTF--
+%unicode|string%(24) "text/plain;charset=utf-8"
+===DONE===