Annotation of embedaddon/php/ext/standard/tests/file/fileinode_error.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: Test fileinode() function: Error conditions
3: --FILE--
4: <?php
5: /*
6: Prototype: int fileinode ( string $filename );
7: Description: Returns the inode number of the file, or FALSE in case of an error.
8: */
9:
10: echo "*** Testing error conditions of fileinode() ***";
11:
12: /* Non-existing file or dir */
13: var_dump( fileinode("/no/such/file/dir") );
14:
15: /* Invalid arguments */
16: var_dump( fileinode("string") );
17: var_dump( fileinode(100) );
18:
1.1.1.2 ! misho 19: /* No.of arguments less than expected */
1.1 misho 20: var_dump( fileinode() );
21:
1.1.1.2 ! misho 22: /* No.of arguments greater than expected */
1.1 misho 23: var_dump( fileinode(__FILE__, "string") );
24:
25: echo "\n*** Done ***";
26:
27: --EXPECTF--
28: *** Testing error conditions of fileinode() ***
29: Warning: fileinode(): stat failed for /no/such/file/dir in %s on line 10
30: bool(false)
31:
32: Warning: fileinode(): stat failed for string in %s on line 13
33: bool(false)
34:
35: Warning: fileinode(): stat failed for 100 in %s on line 14
36: bool(false)
37:
38: Warning: fileinode() expects exactly 1 parameter, 0 given in %s on line 17
39: NULL
40:
41: Warning: fileinode() expects exactly 1 parameter, 2 given in %s on line 20
42: NULL
43:
44: *** Done ***
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>