1--TEST-- 2Test php_uname() function - error conditions - pass function incorrect arguments 3--FILE-- 4<?php 5/* Prototype: string php_uname ([ string $mode ] ) 6 * Description: Returns information about the operating system PHP is running on 7*/ 8 9echo "*** Testing php_uname() - error test\n"; 10 11echo "\n-- Testing php_uname() function with more than expected no. of arguments --\n"; 12var_dump( php_uname('a', true) ); 13 14echo "\n-- Testing php_uname() function with invalid mode --\n"; 15// am invalid mode should result in same o/p as mode 'a' 16var_dump( php_uname('z') == php_uname('z') ); 17 18class barClass { 19} 20 21$fp = fopen(__FILE__, "r"); 22 23echo "\n-- Testing php_uname() function with invalid argument types --\n"; 24var_dump(php_uname(array())); 25var_dump(php_uname(array('color' => 'red', 'item' => 'pen'))); 26var_dump(php_uname(new barClass())); 27var_dump(php_uname($fp)); 28 29fclose($fp); 30?> 31===DONE=== 32--EXPECTF-- 33*** Testing php_uname() - error test 34 35-- Testing php_uname() function with more than expected no. of arguments -- 36 37Warning: php_uname() expects at most 1 parameter, 2 given in %s on line %d 38NULL 39 40-- Testing php_uname() function with invalid mode -- 41bool(true) 42 43-- Testing php_uname() function with invalid argument types -- 44 45Warning: php_uname() expects parameter 1 to be string, array given in %s on line %d 46NULL 47 48Warning: php_uname() expects parameter 1 to be string, array given in %s on line %d 49NULL 50 51Warning: php_uname() expects parameter 1 to be string, object given in %s on line %d 52NULL 53 54Warning: php_uname() expects parameter 1 to be string, resource given in %s on line %d 55NULL 56===DONE===