Skip to content

Commit ba6834f

Browse files
committed
Make bug52820.phpt more robust
Use a more robust error condition...
1 parent bf382a3 commit ba6834f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ext/standard/tests/file/bug52820.phpt

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ if (!function_exists('zend_leak_variable'))
77
/* unfortunately no standard function does a cast to FILE*, so we need
88
* curl to test this */
99
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
10-
$handle=curl_init('http://127.0.0.1:37349/');
10+
$handle=curl_init('file:///i_dont_exist/');
1111
curl_setopt($handle, CURLOPT_VERBOSE, true);
1212
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
1313
if (!curl_setopt($handle, CURLOPT_STDERR, fopen("php://memory", "w+")))
1414
die("skip fopencookie not supported on this platform");
1515
--FILE--
1616
<?php
1717
function do_stuff($url) {
18-
$handle=curl_init('http://127.0.0.1:37349/');
18+
$handle=curl_init('file:///i_dont_exist/');
1919
curl_setopt($handle, CURLOPT_VERBOSE, true);
2020
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
2121
curl_setopt($handle, CURLOPT_STDERR, $o = fopen($url, "w+"));
@@ -42,22 +42,22 @@ echo "\nDone.\n";
4242
--EXPECTF--
4343
temp stream (close after):
4444
About to rewind!
45-
* %ATrying 127.0.0.1...%AConnection refused%A
45+
* Couldn't open file /i_dont_exist/
4646
* Closing connection%A%d
4747
4848
memory stream (close after):
4949
About to rewind!
50-
* %ATrying 127.0.0.1...%AConnection refused%A
50+
* Couldn't open file /i_dont_exist/
5151
* Closing connection%A%d
5252

5353
temp stream (leak):
5454
About to rewind!
55-
* %ATrying 127.0.0.1...%AConnection refused%A
55+
* Couldn't open file /i_dont_exist/
5656
* Closing connection%A%d
5757
5858
memory stream (leak):
5959
About to rewind!
60-
* %ATrying 127.0.0.1...%AConnection refused%A
60+
* Couldn't open file /i_dont_exist/
6161
* Closing connection%A%d
6262

6363
Done.

0 commit comments

Comments
 (0)