Return to syslog_error.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / network |
1.1 misho 1: --TEST-- 2: Test syslog() function : error conditions 3: --FILE-- 4: <?php 5: /* Prototype : bool syslog(int priority, string message) 6: * Description: Generate a system log message 7: * Source code: ext/standard/syslog.c 8: * Alias to functions: 9: */ 10: 11: echo "*** Testing syslog() : error conditions ***\n"; 12: 13: 14: //Test syslog with one more than the expected number of arguments 15: echo "\n-- Testing syslog() function with more than expected no. of arguments --\n"; 16: $priority = 10; 17: $message = 'string_val'; 18: $extra_arg = 10; 19: var_dump( syslog($priority, $message, $extra_arg) ); 20: 21: // Testing syslog with one less than the expected number of arguments 22: echo "\n-- Testing syslog() function with less than expected no. of arguments --\n"; 23: $priority = 10; 24: var_dump( syslog($priority) ); 25: 26: ?> 27: ===DONE=== 28: --EXPECTF-- 29: *** Testing syslog() : error conditions *** 30: 31: -- Testing syslog() function with more than expected no. of arguments -- 32: 33: Warning: syslog() expects exactly 2 parameters, 3 given in %s on line %d 34: NULL 35: 36: -- Testing syslog() function with less than expected no. of arguments -- 37: 38: Warning: syslog() expects exactly 2 parameters, 1 given in %s on line %d 39: NULL 40: ===DONE===