1--TEST--
2Test 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
11echo "*** Testing syslog() : error conditions ***\n";
12
13
14//Test syslog with one more than the expected number of arguments
15echo "\n-- Testing syslog() function with more than expected no. of arguments --\n";
16$priority = 10;
17$message = 'string_val';
18$extra_arg = 10;
19var_dump( syslog($priority, $message, $extra_arg) );
20
21// Testing syslog with one less than the expected number of arguments
22echo "\n-- Testing syslog() function with less than expected no. of arguments --\n";
23$priority = 10;
24var_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
33Warning: syslog() expects exactly 2 parameters, 3 given in %s on line %d
34NULL
35
36-- Testing syslog() function with less than expected no. of arguments --
37
38Warning: syslog() expects exactly 2 parameters, 1 given in %s on line %d
39NULL
40===DONE===
41