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