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