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