xref: /PHP-5.4/ext/curl/tests/curl_basic_019.phpt (revision 84b17658)
1--TEST--
2Test curl_getinfo() function with CURLINFO_EFFECTIVE_URL parameter
3--CREDITS--
4Jean-Marc Fontaine <jmf@durcommefaire.net>
5--SKIPIF--
6<?php
7if (!extension_loaded("curl")) exit("skip curl extension not loaded");
8if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER'))  exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
9?>
10--FILE--
11<?php
12  $host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
13
14  $url = "{$host}/get.php?test=";
15  $ch  = curl_init();
16
17  curl_setopt($ch, CURLOPT_URL, $url);
18  curl_exec($ch);
19  $info = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
20  var_dump($url == $info);
21
22  curl_close($ch);
23?>
24===DONE===
25--EXPECTF--
26Hello World!
27Hello World!bool(true)
28===DONE===
29