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 27--EXPECTF-- 28*** Testing error conditions of fileinode() *** 29Warning: fileinode(): stat failed for /no/such/file/dir in %s on line 10 30bool(false) 31 32Warning: fileinode(): stat failed for string in %s on line 13 33bool(false) 34 35Warning: fileinode(): stat failed for 100 in %s on line 14 36bool(false) 37 38Warning: fileinode() expects exactly 1 parameter, 0 given in %s on line 17 39NULL 40 41Warning: fileinode() expects exactly 1 parameter, 2 given in %s on line 20 42NULL 43 44*** Done *** 45