]> granicus.if.org Git - php/commitdiff
Fix bug #61992 ext\standard\tests\general_functions\bug44295.phpt fails
authorAnatoliy Belsky <ab@php.net>
Thu, 10 May 2012 15:07:38 +0000 (17:07 +0200)
committerAnatoliy Belsky <ab@php.net>
Thu, 10 May 2012 15:07:38 +0000 (17:07 +0200)
Exception text differ on windows

ext/standard/tests/general_functions/bug44295-win.phpt [new file with mode: 0644]
ext/standard/tests/general_functions/bug44295.phpt

diff --git a/ext/standard/tests/general_functions/bug44295-win.phpt b/ext/standard/tests/general_functions/bug44295-win.phpt
new file mode 100644 (file)
index 0000000..d210a54
--- /dev/null
@@ -0,0 +1,29 @@
+--TEST--
+user defined error handler + set_error_handling(EH_THROW)
+--SKIPIF--
+<?php
+       if(substr(PHP_OS, 0, 3) != "WIN") die("skip Windows only");
+       if (!extension_loaded("spl") || is_dir('c:\\not\\exists\\here')) die("skip");
+?>
+--FILE--
+<?php
+$dir = 'c:\\not\\exists\\here';
+
+set_error_handler('my_error_handler');
+function my_error_handler() {$a = func_get_args(); print "in error handler\n"; }
+
+try {
+        print "before\n";
+        $iter = new DirectoryIterator($dir);
+        print get_class($iter) . "\n";
+        print "after\n";
+} catch (Exception $e) {
+        print "in catch: ".$e->getMessage()."\n";
+}
+?>
+==DONE==
+<?php exit(0); ?>
+--EXPECT--
+before
+in catch: DirectoryIterator::__construct(c:\not\exists\here,c:\not\exists\here): The system cannot find the path specified. (code: 3)
+==DONE==
index 9c127199128e1addf9061d7e375546258a4a0768..a184719193ed946c56e3d894453713163138d8c8 100644 (file)
@@ -1,7 +1,10 @@
 --TEST--
 user defined error handler + set_error_handling(EH_THROW)
 --SKIPIF--
-<?php if (!extension_loaded("spl") || is_dir('/this/path/does/not/exist')) die("skip"); ?>
+<?php
+       if(substr(PHP_OS, 0, 3) == "WIN") die("skip Not for Windows");
+       if (!extension_loaded("spl") || is_dir('/this/path/does/not/exist')) die("skip");
+?>
 --FILE--
 <?php
 $dir = '/this/path/does/not/exist';