1--TEST--
2Test define_syslog_variables() function : basic functionality
3--SKIPIF--
4<?php
5if(substr(PHP_OS, 0, 3) == "WIN")
6  die("skip don't run on Windows");
7?>
8--FILE--
9<?php
10/* Prototype  : void define_syslog_variables(void)
11 * Description: Initializes all syslog-related variables
12 * Source code: ext/standard/syslog.c
13 * Alias to functions:
14 */
15
16echo "*** Testing define_syslog_variables() : basic functionality ***\n";
17
18$log_constants = array(
19   		LOG_EMERG,
20   		LOG_ALERT,
21   		LOG_CRIT,
22   		LOG_ERR,
23   		LOG_WARNING,
24   		LOG_NOTICE,
25   		LOG_INFO,
26   		LOG_DEBUG,
27		LOG_KERN,
28		LOG_USER,
29		LOG_MAIL,
30		LOG_DAEMON,
31		LOG_AUTH,
32		LOG_SYSLOG,
33		LOG_LPR,
34		LOG_NEWS,
35		LOG_UUCP,
36		LOG_CRON,
37		LOG_AUTHPRIV,
38		LOG_PID,
39		LOG_CONS,
40		LOG_ODELAY,
41		LOG_NDELAY,
42		LOG_NOWAIT,
43		LOG_PERROR,
44
45		LOG_LOCAL0,
46		LOG_LOCAL1,
47		LOG_LOCAL2,
48		LOG_LOCAL3,
49		LOG_LOCAL4,
50		LOG_LOCAL5,
51		LOG_LOCAL6,
52		LOG_LOCAL7
53
54);
55
56
57$log_variables = array(
58   		"LOG_EMERG",
59   		"LOG_ALERT",
60   		"LOG_CRIT",
61   		"LOG_ERR",
62   		"LOG_WARNING",
63   		"LOG_NOTICE",
64   		"LOG_INFO",
65   		"LOG_DEBUG",
66		"LOG_KERN",
67		"LOG_USER",
68		"LOG_MAIL",
69		"LOG_DAEMON",
70		"LOG_AUTH",
71		"LOG_SYSLOG",
72		"LOG_LPR",
73		"LOG_NEWS",
74		"LOG_UUCP",
75		"LOG_CRON",
76		"LOG_AUTHPRIV",
77		"LOG_PID",
78		"LOG_CONS",
79		"LOG_ODELAY",
80		"LOG_NDELAY",
81		"LOG_NOWAIT",
82		"LOG_PERROR",
83
84		"LOG_LOCAL0",
85		"LOG_LOCAL1",
86		"LOG_LOCAL2",
87		"LOG_LOCAL3",
88		"LOG_LOCAL4",
89		"LOG_LOCAL5",
90		"LOG_LOCAL6",
91		"LOG_LOCAL7"
92);
93
94error_reporting(E_ALL);
95$failed = false;
96
97// show variables not defined
98foreach($log_variables as $log_var) {
99   if (isset($$log_var)) {
100      $failed = true;
101      echo "FAILED: variable defined\n";
102   }
103}
104
105var_dump( define_syslog_variables() );
106
107// show variables now defined
108for ($t = 0; $t < count($log_variables); $t++) {
109   if (isset($$log_variables[$t]) === false || $$log_variables[$t] != $log_constants[$t]) {
110      $failed = true;
111      echo "FAILED: $log_variables[$t] doesn't contain the correct value\n";
112   }
113}
114
115if ($failed == false) {
116   echo "PASSED\n";
117}
118?>
119===DONE===
120--EXPECTF--
121*** Testing define_syslog_variables() : basic functionality ***
122
123Deprecated: Function define_syslog_variables() is deprecated in %s on line %d
124NULL
125PASSED
126===DONE===
127