xref: /PHP-8.2/ext/standard/tests/dir/bug80960.phpt (revision 3ccc0409)
1--TEST--
2Fix #80960 (opendir() warning wrong info when failed on Windows)
3--SKIPIF--
4<?php
5if (PHP_OS_FAMILY !== "Windows") die("skip for Windows only");
6?>
7--FILE--
8<?php
9opendir("notexist*");
10opendir("notexist?");
11opendir(str_pad("longname", PHP_MAXPATHLEN - strlen(getcwd()), "_"));
12?>
13--EXPECTF--
14Warning: opendir(notexist*): %s (code: 123) in %s on line %d
15
16Warning: opendir(notexist*): Failed to open directory: No such file or directory in %s on line %d
17
18Warning: opendir(notexist?): %s (code: 123) in %s on line %d
19
20Warning: opendir(notexist?): Failed to open directory: No such file or directory in %s on line %d
21
22Warning: opendir(longname%r_+%r): %s (code: 111) in %s on line %d
23
24Warning: opendir(longname%r_+%r): Failed to open directory: Filename too long in %s on line %d
25