Return to interface_exists_error.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / class_object |
1.1 misho 1: --TEST-- 2: Test interface_exists() function : error conditions 3: --FILE-- 4: <?php 5: /* Prototype : bool interface_exists(string classname [, bool autoload]) 6: * Description: Checks if the class exists 7: * Source code: Zend/zend_builtin_functions.c 8: * Alias to functions: 9: */ 10: 11: echo "*** Testing interface_exists() : error conditions ***\n"; 12: 13: // Zero arguments 14: echo "\n-- Testing interface_exists() function with Zero arguments --\n"; 15: var_dump( interface_exists() ); 16: 17: //Test interface_exists with one more than the expected number of arguments 18: echo "\n-- Testing interface_exists() function with more than expected no. of arguments --\n"; 19: $classname = 'string_val'; 20: $autoload = true; 21: $extra_arg = 10; 22: var_dump( interface_exists($classname, $autoload, $extra_arg) ); 23: 24: ?> 25: ===DONE=== 26: --EXPECTF-- 27: *** Testing interface_exists() : error conditions *** 28: 29: -- Testing interface_exists() function with Zero arguments -- 30: 31: Warning: interface_exists() expects at least 1 parameter, 0 given in %sinterface_exists_error.php on line %d 32: NULL 33: 34: -- Testing interface_exists() function with more than expected no. of arguments -- 35: 36: Warning: interface_exists() expects at most 2 parameters, 3 given in %sinterface_exists_error.php on line %d 37: NULL 38: ===DONE===