20 \PHPUnit_Framework_Error_Warning::$enabled =
true;
22 return parent::tearDown();
33 'level_name' =>
'ERROR',
36 'datetime' =>
new \DateTime(
"@0"),
41 $message = json_decode($formatter->format($record),
true);
43 $this->assertEquals(
"1970-01-01T00:00:00.000000+00:00", $message[
'@timestamp']);
44 $this->assertEquals(
'log', $message[
'@message']);
45 $this->assertEquals(
'meh', $message[
'@fields'][
'channel']);
46 $this->assertContains(
'meh', $message[
'@tags']);
47 $this->assertEquals(
Logger::ERROR, $message[
'@fields'][
'level']);
48 $this->assertEquals(
'test', $message[
'@type']);
49 $this->assertEquals(
'hostname', $message[
'@source']);
53 $message = json_decode($formatter->format($record),
true);
55 $this->assertEquals(
'mysystem', $message[
'@type']);
66 'level_name' =>
'ERROR',
68 'context' =>
array(
'from' =>
'logger'),
69 'datetime' =>
new \DateTime(
"@0"),
70 'extra' =>
array(
'file' =>
'test',
'line' => 14),
74 $message = json_decode($formatter->format($record),
true);
76 $this->assertEquals(
'test', $message[
'@fields'][
'file']);
77 $this->assertEquals(14, $message[
'@fields'][
'line']);
88 'level_name' =>
'ERROR',
90 'context' =>
array(
'from' =>
'logger'),
91 'datetime' =>
new \DateTime(
"@0"),
92 'extra' =>
array(
'key' =>
'pair'),
96 $message = json_decode($formatter->format($record),
true);
98 $message_array = $message[
'@fields'];
100 $this->assertArrayHasKey(
'ctxt_from', $message_array);
101 $this->assertEquals(
'logger', $message_array[
'ctxt_from']);
105 $message = json_decode($formatter->format($record),
true);
107 $message_array = $message[
'@fields'];
109 $this->assertArrayHasKey(
'CTXfrom', $message_array);
110 $this->assertEquals(
'logger', $message_array[
'CTXfrom']);
121 'level_name' =>
'ERROR',
123 'context' =>
array(
'from' =>
'logger'),
124 'datetime' =>
new \DateTime(
"@0"),
125 'extra' =>
array(
'key' =>
'pair'),
129 $message = json_decode($formatter->format($record),
true);
131 $message_array = $message[
'@fields'];
133 $this->assertArrayHasKey(
'key', $message_array);
134 $this->assertEquals(
'pair', $message_array[
'key']);
138 $message = json_decode($formatter->format($record),
true);
140 $message_array = $message[
'@fields'];
142 $this->assertArrayHasKey(
'EXTkey', $message_array);
143 $this->assertEquals(
'pair', $message_array[
'EXTkey']);
151 'level_name' =>
'ERROR',
153 'context' =>
array(
'from' =>
'logger'),
154 'datetime' =>
new \DateTime(
"@0"),
155 'extra' =>
array(
'key' =>
'pair'),
159 $message = json_decode($formatter->format($record),
true);
161 $this->assertArrayHasKey(
'@type', $message);
162 $this->assertEquals(
'app', $message[
'@type']);
173 'level_name' =>
'ERROR',
175 'context' =>
array(),
176 'datetime' =>
new \DateTime(
"@0"),
181 $message = json_decode($formatter->format($record),
true);
183 $this->assertEquals(
"1970-01-01T00:00:00.000000+00:00", $message[
'@timestamp']);
184 $this->assertEquals(
"1", $message[
'@version']);
185 $this->assertEquals(
'log', $message[
'message']);
186 $this->assertEquals(
'meh', $message[
'channel']);
187 $this->assertEquals(
'ERROR', $message[
'level']);
188 $this->assertEquals(
'test', $message[
'type']);
189 $this->assertEquals(
'hostname', $message[
'host']);
193 $message = json_decode($formatter->format($record),
true);
195 $this->assertEquals(
'mysystem', $message[
'type']);
206 'level_name' =>
'ERROR',
208 'context' =>
array(
'from' =>
'logger'),
209 'datetime' =>
new \DateTime(
"@0"),
210 'extra' =>
array(
'file' =>
'test',
'line' => 14),
214 $message = json_decode($formatter->format($record),
true);
216 $this->assertEquals(
'test', $message[
'file']);
217 $this->assertEquals(14, $message[
'line']);
228 'level_name' =>
'ERROR',
230 'context' =>
array(
'from' =>
'logger'),
231 'datetime' =>
new \DateTime(
"@0"),
232 'extra' =>
array(
'key' =>
'pair'),
236 $message = json_decode($formatter->format($record),
true);
238 $this->assertArrayHasKey(
'ctxt_from', $message);
239 $this->assertEquals(
'logger', $message[
'ctxt_from']);
243 $message = json_decode($formatter->format($record),
true);
245 $this->assertArrayHasKey(
'CTXfrom', $message);
246 $this->assertEquals(
'logger', $message[
'CTXfrom']);
257 'level_name' =>
'ERROR',
259 'context' =>
array(
'from' =>
'logger'),
260 'datetime' =>
new \DateTime(
"@0"),
261 'extra' =>
array(
'key' =>
'pair'),
265 $message = json_decode($formatter->format($record),
true);
267 $this->assertArrayHasKey(
'key', $message);
268 $this->assertEquals(
'pair', $message[
'key']);
272 $message = json_decode($formatter->format($record),
true);
274 $this->assertArrayHasKey(
'EXTkey', $message);
275 $this->assertEquals(
'pair', $message[
'EXTkey']);
283 'level_name' =>
'ERROR',
285 'context' =>
array(
'from' =>
'logger'),
286 'datetime' =>
new \DateTime(
"@0"),
287 'extra' =>
array(
'key' =>
'pair'),
291 $message = json_decode($formatter->format($record),
true);
293 $this->assertArrayHasKey(
'type', $message);
294 $this->assertEquals(
'app', $message[
'type']);
299 if (version_compare(PHP_VERSION,
'5.5.0',
'<')) {
301 \PHPUnit_Framework_Error_Warning::$enabled =
false;
306 'level_name' =>
'ERROR',
307 'channel' =>
'¯\_(ツ)_/¯',
308 'context' =>
array(),
309 'datetime' =>
new \DateTime(
"@0"),
311 'user_agent' =>
"\xD6WN; FBCR/OrangeEspa\xF1a; Vers\xE3o/4.0; F\xE4rist",
316 $message = json_decode($formatter->format($record),
true);
318 $this->assertEquals(
"1970-01-01T00:00:00.000000+00:00", $message[
'@timestamp']);
319 $this->assertEquals(
'log', $message[
'@message']);
320 $this->assertEquals(
'¯\_(ツ)_/¯', $message[
'@fields'][
'channel']);
321 $this->assertContains(
'¯\_(ツ)_/¯', $message[
'@tags']);
322 $this->assertEquals(
Logger::ERROR, $message[
'@fields'][
'level']);
323 $this->assertEquals(
'test', $message[
'@type']);
324 $this->assertEquals(
'hostname', $message[
'@source']);
325 if (version_compare(PHP_VERSION,
'5.5.0',
'>=')) {
326 $this->assertEquals(
'ÖWN; FBCR/OrangeEspaña; Versão/4.0; Färist', $message[
'@fields'][
'user_agent']);
330 $this->assertEquals(null, $message[
'@fields'][
'user_agent']);
const ERROR
Runtime errors.
Create styles array
The data for the language used.