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