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