xref: /PHP-7.1/ext/curl/tests/curl_basic_010.phpt (revision 54fee595)
1--TEST--
2Test curl_error() & curl_errno() function with problematic proxy
3--CREDITS--
4TestFest 2009 - AFUP - Perrick Penet <perrick@noparking.net>
5--SKIPIF--
6<?php
7	if (!extension_loaded("curl")) print "skip";
8	$addr = "www.".uniqid().".".uniqid();
9	if (gethostbyname($addr) != $addr) {
10		print "skip catch all dns";
11	}
12?>
13--FILE--
14<?php
15
16$url = "http://www.example.org";
17$ch = curl_init();
18curl_setopt($ch, CURLOPT_PROXY, uniqid().":".uniqid());
19curl_setopt($ch, CURLOPT_URL, $url);
20
21curl_exec($ch);
22var_dump(curl_error($ch));
23var_dump(curl_errno($ch));
24curl_close($ch);
25
26
27?>
28--EXPECTF--
29%unicode|string%(%d) "%r(Couldn't resolve proxy|Could not resolve proxy:|Could not resolve host:|Could not resolve:)%r %s"
30int(5)
31