Annotation of embedaddon/php/ext/standard/tests/file/stat_error-win32.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: Test stat() function: error conditions
3: --SKIPIF--
4: <?php
5: if (substr(PHP_OS, 0, 3) != 'WIN') {
6: die('skip.. only for Windows');
7: }
8: ?>
9: --FILE--
10: <?php
11: /*
12: Prototype: array stat ( string $filename );
13: Description: Gives information about a file
14: */
15:
16: $file_path = dirname(__FILE__);
17: $arr = array(__FILE__);
18:
19: echo "\n*** Testing stat() for error conditions ***\n";
20: var_dump( stat() ); // args < expected
21: var_dump( stat(__FILE__, 2) ); // file, args > expected
22: var_dump( stat(dirname(__FILE__), 2) ); //dir, args > expected
23:
24: var_dump( stat("$file_path/temp.tmp") ); // non existing file
25: var_dump( stat("$file_path/temp/") ); // non existing dir
26: var_dump( stat(22) ); // scalar argument
27: var_dump( stat($arr) ); // array argument
28:
29: echo "Done\n";
30: ?>
31: --EXPECTF--
32: *** Testing stat() for error conditions ***
33:
34: Warning: stat() expects exactly 1 parameter, 0 given in %s on line %d
35: NULL
36:
37: Warning: stat() expects exactly 1 parameter, 2 given in %s on line %d
38: NULL
39:
40: Warning: stat() expects exactly 1 parameter, 2 given in %s on line %d
41: NULL
42:
43: Warning: stat(): stat failed for %s in %s on line %d
44: bool(false)
45:
46: Warning: stat(): stat failed for %s in %s on line %d
47: bool(false)
48:
49: Warning: stat(): stat failed for 22 in %s on line %d
50: bool(false)
51:
1.1.1.2 ! misho 52: Warning: stat() expects parameter 1 to be a valid path, array given in %s on line %d
1.1 misho 53: NULL
54: Done
55:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>