@@ -33,23 +33,15 @@ public function testLoadWithDefault()
33
33
34
34
$ handler = $ container ->getDefinition ('monolog.handler.main ' );
35
35
$ this ->assertDICDefinitionClass ($ handler , 'Monolog\Handler\StreamHandler ' );
36
- $ this ->assertDICConstructorArguments ($ handler , ['%kernel.logs_dir%/%kernel.environment%.log ' , \Monolog \Logger::DEBUG , true , null , false ]
37
- );
38
- $ this ->assertDICDefinitionMethodCallAt (0 , $ handler , 'pushProcessor ' , [new Reference ('monolog.processor.psr_log_message ' )]
39
- );
36
+ $ this ->assertDICConstructorArguments ($ handler , ['%kernel.logs_dir%/%kernel.environment%.log ' , \Monolog \Logger::DEBUG , true , null , false ]);
37
+ $ this ->assertDICDefinitionMethodCallAt (0 , $ handler , 'pushProcessor ' , [new Reference ('monolog.processor.psr_log_message ' )]);
40
38
}
41
39
42
40
public function testLoadWithCustomValues ()
43
41
{
44
- $ container = $ this ->getContainer (
45
- [
46
- [
47
- 'handlers ' => [
42
+ $ container = $ this ->getContainer ([['handlers ' => [
48
43
'custom ' => ['type ' => 'stream ' , 'path ' => '/tmp/symfony.log ' , 'bubble ' => false , 'level ' => 'ERROR ' , 'file_permission ' => '0666 ' , 'use_locking ' => true ]
49
- ]
50
- ]
51
- ]
52
- );
44
+ ]]]);
53
45
$ this ->assertTrue ($ container ->hasDefinition ('monolog.logger ' ));
54
46
$ this ->assertTrue ($ container ->hasDefinition ('monolog.handler.custom ' ));
55
47
@@ -64,16 +56,10 @@ public function testLoadWithCustomValues()
64
56
65
57
public function testLoadWithNestedHandler ()
66
58
{
67
- $ container = $ this ->getContainer (
68
- [
69
- [
70
- 'handlers ' => [
59
+ $ container = $ this ->getContainer ([['handlers ' => [
71
60
'custom ' => ['type ' => 'stream ' , 'path ' => '/tmp/symfony.log ' , 'bubble ' => false , 'level ' => 'ERROR ' , 'file_permission ' => '0666 ' ],
72
61
'nested ' => ['type ' => 'stream ' , 'path ' => '/tmp/symfony.log ' , 'bubble ' => false , 'level ' => 'ERROR ' , 'file_permission ' => '0666 ' , 'nested ' => true ]
73
- ]
74
- ]
75
- ]
76
- );
62
+ ]]]);
77
63
$ this ->assertTrue ($ container ->hasDefinition ('monolog.logger ' ));
78
64
$ this ->assertTrue ($ container ->hasDefinition ('monolog.handler.custom ' ));
79
65
$ this ->assertTrue ($ container ->hasDefinition ('monolog.handler.nested ' ));
@@ -275,18 +261,10 @@ public function testSocketHandler()
275
261
$ this ->assertContains ('connection_string ' , $ e ->getMessage ());
276
262
}
277
263
278
- $ container = $ this ->getContainer (
279
- [
280
- [
281
- 'handlers ' => [
282
- 'socket ' => [
264
+ $ container = $ this ->getContainer ([['handlers ' => ['socket ' => [
283
265
'type ' => 'socket ' , 'timeout ' => 1 , 'persistent ' => true ,
284
266
'connection_string ' => 'localhost:50505 ' , 'connection_timeout ' => '0.6 '
285
- ]
286
- ]
287
- ]
288
- ]
289
- );
267
+ ]]]]);
290
268
$ this ->assertTrue ($ container ->hasDefinition ('monolog.logger ' ));
291
269
$ this ->assertTrue ($ container ->hasDefinition ('monolog.handler.socket ' ));
292
270
@@ -297,8 +275,7 @@ public function testSocketHandler()
297
275
$ handler = $ container ->getDefinition ('monolog.handler.socket ' );
298
276
$ this ->assertDICDefinitionClass ($ handler , 'Monolog\Handler\SocketHandler ' );
299
277
$ this ->assertDICConstructorArguments ($ handler , ['localhost:50505 ' , \Monolog \Logger::DEBUG , true ]);
300
- $ this ->assertDICDefinitionMethodCallAt (0 , $ handler , 'pushProcessor ' , [new Reference ('monolog.processor.psr_log_message ' )]
301
- );
278
+ $ this ->assertDICDefinitionMethodCallAt (0 , $ handler , 'pushProcessor ' , [new Reference ('monolog.processor.psr_log_message ' )]);
302
279
$ this ->assertDICDefinitionMethodCallAt (1 , $ handler , 'setTimeout ' , ['1 ' ]);
303
280
$ this ->assertDICDefinitionMethodCallAt (2 , $ handler , 'setConnectionTimeout ' , ['0.6 ' ]);
304
281
$ this ->assertDICDefinitionMethodCallAt (3 , $ handler , 'setPersistent ' , [true ]);
@@ -318,17 +295,9 @@ public function testRavenHandlerWhenADSNIsSpecified()
318
295
{
319
296
$ dsn = 'http://43f6017361224d098402974103bfc53d:a6a0538fc2934ba2bed32e08741b2cd3@marca.python.live.cheggnet.com:9000/1 ' ;
320
297
321
- $ container = $ this ->getContainer (
322
- [
323
- [
324
- 'handlers ' => [
325
- 'raven ' => [
298
+ $ container = $ this ->getContainer ([['handlers ' => ['raven ' => [
326
299
'type ' => 'raven ' , 'dsn ' => $ dsn
327
- ]
328
- ]
329
- ]
330
- ]
331
- );
300
+ ]]]]);
332
301
$ this ->assertTrue ($ container ->hasDefinition ('monolog.logger ' ));
333
302
$ this ->assertTrue ($ container ->hasDefinition ('monolog.handler.raven ' ));
334
303
@@ -344,17 +313,9 @@ public function testRavenHandlerWhenADSNIsSpecified()
344
313
345
314
public function testRavenHandlerWhenADSNAndAClientAreSpecified ()
346
315
{
347
- $ container = $ this ->getContainer (
348
- [
349
- [
350
- 'handlers ' => [
351
- 'raven ' => [
316
+ $ container = $ this ->getContainer ([['handlers ' => ['raven ' => [
352
317
'type ' => 'raven ' , 'dsn ' => 'foobar ' , 'client_id ' => 'raven.client '
353
- ]
354
- ]
355
- ]
356
- ]
357
- );
318
+ ]]]]);
358
319
359
320
$ this ->assertFalse ($ container ->hasDefinition ('raven.client ' ));
360
321
@@ -368,17 +329,9 @@ public function testRavenHandlerWhenADSNAndAClientAreSpecified()
368
329
369
330
public function testRavenHandlerWhenAClientIsSpecified ()
370
331
{
371
- $ container = $ this ->getContainer (
372
- [
373
- [
374
- 'handlers ' => [
375
- 'raven ' => [
332
+ $ container = $ this ->getContainer ([['handlers ' => ['raven ' => [
376
333
'type ' => 'raven ' , 'client_id ' => 'raven.client '
377
- ]
378
- ]
379
- ]
380
- ]
381
- );
334
+ ]]]]);
382
335
383
336
$ this ->assertFalse ($ container ->hasDefinition ('raven.client ' ));
384
337
@@ -404,17 +357,9 @@ public function testSentryHandlerWhenADSNIsSpecified()
404
357
{
405
358
$ dsn = 'http://43f6017361224d098402974103bfc53d:a6a0538fc2934ba2bed32e08741b2cd3@marca.python.live.cheggnet.com:9000/1 ' ;
406
359
407
- $ container = $ this ->getContainer (
408
- [
409
- [
410
- 'handlers ' => [
411
- 'sentry ' => [
360
+ $ container = $ this ->getContainer ([['handlers ' => ['sentry ' => [
412
361
'type ' => 'sentry ' , 'dsn ' => $ dsn
413
- ]
414
- ]
415
- ]
416
- ]
417
- );
362
+ ]]]]);
418
363
$ this ->assertTrue ($ container ->hasDefinition ('monolog.logger ' ));
419
364
$ this ->assertTrue ($ container ->hasDefinition ('monolog.handler.sentry ' ));
420
365
@@ -491,33 +436,17 @@ public function testLogglyHandler()
491
436
}
492
437
493
438
try {
494
- $ this ->getContainer (
495
- [
496
- [
497
- 'handlers ' => [
498
- 'loggly ' => [
439
+ $ this ->getContainer ([['handlers ' => ['loggly ' => [
499
440
'type ' => 'loggly ' , 'token ' => $ token , 'tags ' => 'x, 1zone ,www.loggly.com,-us,apache$ '
500
- ]
501
- ]
502
- ]
503
- ]
504
- );
441
+ ]]]]);
505
442
$ this ->fail ();
506
443
} catch (InvalidConfigurationException $ e ) {
507
444
$ this ->assertContains ('-us, apache$ ' , $ e ->getMessage ());
508
445
}
509
446
510
- $ container = $ this ->getContainer (
511
- [
512
- [
513
- 'handlers ' => [
514
- 'loggly ' => [
447
+ $ container = $ this ->getContainer ([['handlers ' => ['loggly ' => [
515
448
'type ' => 'loggly ' , 'token ' => $ token
516
- ]
517
- ]
518
- ]
519
- ]
520
- );
449
+ ]]]]);
521
450
$ this ->assertTrue ($ container ->hasDefinition ('monolog.logger ' ));
522
451
$ this ->assertTrue ($ container ->hasDefinition ('monolog.handler.loggly ' ));
523
452
@@ -530,17 +459,9 @@ public function testLogglyHandler()
530
459
$ this ->assertDICDefinitionMethodCallAt (0 , $ handler , 'pushProcessor ' , [new Reference ('monolog.processor.psr_log_message ' )]
531
460
);
532
461
533
- $ container = $ this ->getContainer (
534
- [
535
- [
536
- 'handlers ' => [
537
- 'loggly ' => [
462
+ $ container = $ this ->getContainer ([['handlers ' => ['loggly ' => [
538
463
'type ' => 'loggly ' , 'token ' => $ token , 'tags ' => [' ' , 'foo ' , '' , 'bar ' ]
539
- ]
540
- ]
541
- ]
542
- ]
543
- );
464
+ ]]]]);
544
465
$ handler = $ container ->getDefinition ('monolog.handler.loggly ' );
545
466
$ this ->assertDICDefinitionMethodCallAt (0 , $ handler , 'pushProcessor ' , [new Reference ('monolog.processor.psr_log_message ' )]
546
467
);
@@ -550,16 +471,10 @@ public function testLogglyHandler()
550
471
/** @group legacy */
551
472
public function testFingersCrossedHandlerWhenExcluded404sAreSpecified ()
552
473
{
553
- $ container = $ this ->getContainer (
554
- [
555
- [
556
- 'handlers ' => [
474
+ $ container = $ this ->getContainer ([['handlers ' => [
557
475
'main ' => ['type ' => 'fingers_crossed ' , 'handler ' => 'nested ' , 'excluded_404s ' => ['^/foo ' , '^/bar ' ]],
558
476
'nested ' => ['type ' => 'stream ' , 'path ' => '/tmp/symfony.log ' ]
559
- ]
560
- ]
561
- ]
562
- );
477
+ ]]]);
563
478
564
479
$ this ->assertTrue ($ container ->hasDefinition ('monolog.logger ' ));
565
480
$ this ->assertTrue ($ container ->hasDefinition ('monolog.handler.main ' ));
@@ -587,20 +502,14 @@ public function testFingersCrossedHandlerWhenExcludedHttpCodesAreSpecified()
587
502
$ this ->markTestSkipped ('Symfony Monolog 4.1+ is needed. ' );
588
503
}
589
504
590
- $ container = $ this ->getContainer (
591
- [
592
- [
593
- 'handlers ' => [
505
+ $ container = $ this ->getContainer ([['handlers ' => [
594
506
'main ' => [
595
507
'type ' => 'fingers_crossed ' ,
596
508
'handler ' => 'nested ' ,
597
509
'excluded_http_codes ' => [403 , 404 , [405 => ['^/foo ' , '^/bar ' ]]]
598
510
],
599
511
'nested ' => ['type ' => 'stream ' , 'path ' => '/tmp/symfony.log ' ]
600
- ]
601
- ]
602
- ]
603
- );
512
+ ]]]);
604
513
605
514
$ this ->assertTrue ($ container ->hasDefinition ('monolog.logger ' ));
606
515
$ this ->assertTrue ($ container ->hasDefinition ('monolog.handler.main ' ));
0 commit comments