1--TEST--
2Test 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
10echo "*** Testing fileowner(): error conditions ***\n";
11/* Non-existing file or dir */
12var_dump( fileowner("/no/such/file/dir") );
13
14/* Invalid arguments */
15var_dump( fileowner("string") );
16var_dump( fileowner(100) );
17
18/* Invalid no.of arguments */
19var_dump( fileowner() );  // args < expected
20var_dump( fileowner("/no/such/file", "root") );  // args > expected
21
22echo "\n*** Done ***\n";
23?>
24--EXPECTF--
25*** Testing fileowner(): error conditions ***
26
27Warning: fileowner(): stat failed for /no/such/file/dir in %s on line %d
28bool(false)
29
30Warning: fileowner(): stat failed for string in %s on line %d
31bool(false)
32
33Warning: fileowner(): stat failed for 100 in %s on line %d
34bool(false)
35
36Warning: fileowner() expects exactly 1 parameter, 0 given in %s on line %d
37NULL
38
39Warning: fileowner() expects exactly 1 parameter, 2 given in %s on line %d
40NULL
41
42*** Done ***
43