xref: /PHP-7.1/ext/curl/tests/curl_basic_016.phpt (revision 7af945e2)
1--TEST--
2Test curl_getinfo() function with basic functionality
3--CREDITS--
4Jean-Marc Fontaine <jmf@durcommefaire.net>
5--SKIPIF--
6<?php
7if (!extension_loaded("curl")) exit("skip curl extension not loaded");
8$curl_version = curl_version();
9if ($curl_version['version_number'] > 0x071201) {
10    exit("skip: tests works only on older versions of curl");
11}
12?>
13--FILE--
14<?php
15  $ch   = curl_init();
16  $info = curl_getinfo($ch);
17  var_dump($info);
18?>
19===DONE===
20--EXPECTF--
21array(2%d) {
22  [%u|b%"url"]=>
23  string(0) ""
24  ["content_type"]=>
25  NULL
26  ["http_code"]=>
27  int(0)
28  ["header_size"]=>
29  int(0)
30  ["request_size"]=>
31  int(0)
32  ["filetime"]=>
33  int(0)
34  ["ssl_verify_result"]=>
35  int(0)
36  ["redirect_count"]=>
37  int(0)
38  ["total_time"]=>
39  float(0)
40  ["namelookup_time"]=>
41  float(0)
42  ["connect_time"]=>
43  float(0)
44  ["pretransfer_time"]=>
45  float(0)
46  ["size_upload"]=>
47  float(0)
48  ["size_download"]=>
49  float(0)
50  ["speed_download"]=>
51  float(0)
52  ["speed_upload"]=>
53  float(0)
54  ["download_content_length"]=>
55  float(%f)
56  ["upload_content_length"]=>
57  float(%f)
58  ["starttransfer_time"]=>
59  float(0)
60  ["redirect_time"]=>
61  float(0)
62}
63===DONE===
64