Annotation of embedaddon/php/ext/standard/tests/dir/dir_variation5.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: Test dir() function : usage variations - open a file instead of directory
1.1.1.2 ! misho 3: --SKIPIF--
! 4: <?php
! 5: if (substr(PHP_OS, 0, 3) == 'WIN') {
! 6: die('skip.. Not valid for Windows');
! 7: }
! 8: ?>
1.1 misho 9: --FILE--
10: <?php
11: /*
12: * Prototype : object dir(string $directory[, resource $context])
13: * Description: Directory class with properties, handle and class and methods read, rewind and close
14: * Source code: ext/standard/dir.c
15: */
16:
17: /*
18: * Passing a file as argument to dir() function instead of a directory
19: * and checking if proper warning message is generated.
20: */
21:
22: echo "*** Testing dir() : open a file instead of a directory ***\n";
23:
24: // open the file instead of directory
25: $d = dir(__FILE__);
26: var_dump( $d );
27:
28: echo "Done";
29: ?>
30: --EXPECTF--
31: *** Testing dir() : open a file instead of a directory ***
32:
33: Warning: dir(%s): failed to open dir: %s in %s on line %d
34: bool(false)
35: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>