Skip to content

Commit 266578f

Browse files
committed
Fix bug #61992 ext\standard\tests\general_functions\bug44295.phpt fails
Exception text differ on windows
1 parent 652632a commit 266578f

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--TEST--
2+
user defined error handler + set_error_handling(EH_THROW)
3+
--SKIPIF--
4+
<?php
5+
if(substr(PHP_OS, 0, 3) != "WIN") die("skip Windows only");
6+
if (!extension_loaded("spl") || is_dir('c:\\not\\exists\\here')) die("skip");
7+
?>
8+
--FILE--
9+
<?php
10+
$dir = 'c:\\not\\exists\\here';
11+
12+
set_error_handler('my_error_handler');
13+
function my_error_handler() {$a = func_get_args(); print "in error handler\n"; }
14+
15+
try {
16+
print "before\n";
17+
$iter = new DirectoryIterator($dir);
18+
print get_class($iter) . "\n";
19+
print "after\n";
20+
} catch (Exception $e) {
21+
print "in catch: ".$e->getMessage()."\n";
22+
}
23+
?>
24+
==DONE==
25+
<?php exit(0); ?>
26+
--EXPECT--
27+
before
28+
in catch: DirectoryIterator::__construct(c:\not\exists\here,c:\not\exists\here): The system cannot find the path specified. (code: 3)
29+
==DONE==

ext/standard/tests/general_functions/bug44295.phpt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
--TEST--
22
user defined error handler + set_error_handling(EH_THROW)
33
--SKIPIF--
4-
<?php if (!extension_loaded("spl") || is_dir('/this/path/does/not/exist')) die("skip"); ?>
4+
<?php
5+
if(substr(PHP_OS, 0, 3) == "WIN") die("skip Not for Windows");
6+
if (!extension_loaded("spl") || is_dir('/this/path/does/not/exist')) die("skip");
7+
?>
58
--FILE--
69
<?php
710
$dir = '/this/path/does/not/exist';

0 commit comments

Comments
 (0)