1--TEST--
2Test define_syslog_variables() function : variation
3--FILE--
4<?php
5/* Prototype  : void define_syslog_variables(void)
6 * Description: Initializes all syslog-related variables
7 * Source code: ext/standard/syslog.c
8 * Alias to functions:
9 */
10
11define_syslog_variables();
12
13echo "*** Testing define_syslog_variables() : variation ***\n";
14
15$log_constants = array(
16   		LOG_EMERG,
17   		LOG_ALERT,
18   		LOG_CRIT,
19   		LOG_ERR,
20   		LOG_WARNING,
21   		LOG_NOTICE,
22   		LOG_INFO,
23   		LOG_DEBUG,
24		LOG_KERN,
25		LOG_USER,
26		LOG_MAIL,
27		LOG_DAEMON,
28		LOG_AUTH,
29		LOG_SYSLOG,
30		LOG_LPR,
31		LOG_NEWS,
32		LOG_UUCP,
33		LOG_CRON,
34		LOG_AUTHPRIV,
35		LOG_PID,
36		LOG_CONS,
37		LOG_ODELAY,
38		LOG_NDELAY,
39		LOG_NOWAIT,
40		LOG_PERROR,
41);
42
43
44$log_variables = array(
45   		"LOG_EMERG",
46   		"LOG_ALERT",
47   		"LOG_CRIT",
48   		"LOG_ERR",
49   		"LOG_WARNING",
50   		"LOG_NOTICE",
51   		"LOG_INFO",
52   		"LOG_DEBUG",
53		"LOG_KERN",
54		"LOG_USER",
55		"LOG_MAIL",
56		"LOG_DAEMON",
57		"LOG_AUTH",
58		"LOG_SYSLOG",
59		"LOG_LPR",
60		"LOG_NEWS",
61		"LOG_UUCP",
62		"LOG_CRON",
63		"LOG_AUTHPRIV",
64		"LOG_PID",
65		"LOG_CONS",
66		"LOG_ODELAY",
67		"LOG_NDELAY",
68		"LOG_NOWAIT",
69		"LOG_PERROR",
70);
71
72error_reporting(E_ALL);
73$failed = false;
74
75// show variables defined
76for ($t = 0; $t < count($log_variables); $t++) {
77   if (isset($$log_variables[$t]) === false || $$log_variables[$t] != $log_constants[$t]) {
78      $failed = true;
79      echo "FAILED: $log_variables[$t] doesn't contain the correct value\n";
80   }
81}
82
83if ($failed == false) {
84   echo "PASSED\n";
85}
86?>
87===DONE===
88--EXPECTF--
89Deprecated: Function define_syslog_variables() is deprecated in %s on line %d
90*** Testing define_syslog_variables() : variation ***
91PASSED
92===DONE===
93