@@ -33,23 +33,15 @@ public function testLoadWithDefault()
3333
3434 $ handler = $ container ->getDefinition ('monolog.handler.main ' );
3535 $ 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 ' )]);
4038 }
4139
4240 public function testLoadWithCustomValues ()
4341 {
44- $ container = $ this ->getContainer (
45- [
46- [
47- 'handlers ' => [
42+ $ container = $ this ->getContainer ([['handlers ' => [
4843 'custom ' => ['type ' => 'stream ' , 'path ' => '/tmp/symfony.log ' , 'bubble ' => false , 'level ' => 'ERROR ' , 'file_permission ' => '0666 ' , 'use_locking ' => true ]
49- ]
50- ]
51- ]
52- );
44+ ]]]);
5345 $ this ->assertTrue ($ container ->hasDefinition ('monolog.logger ' ));
5446 $ this ->assertTrue ($ container ->hasDefinition ('monolog.handler.custom ' ));
5547
@@ -64,16 +56,10 @@ public function testLoadWithCustomValues()
6456
6557 public function testLoadWithNestedHandler ()
6658 {
67- $ container = $ this ->getContainer (
68- [
69- [
70- 'handlers ' => [
59+ $ container = $ this ->getContainer ([['handlers ' => [
7160 'custom ' => ['type ' => 'stream ' , 'path ' => '/tmp/symfony.log ' , 'bubble ' => false , 'level ' => 'ERROR ' , 'file_permission ' => '0666 ' ],
7261 'nested ' => ['type ' => 'stream ' , 'path ' => '/tmp/symfony.log ' , 'bubble ' => false , 'level ' => 'ERROR ' , 'file_permission ' => '0666 ' , 'nested ' => true ]
73- ]
74- ]
75- ]
76- );
62+ ]]]);
7763 $ this ->assertTrue ($ container ->hasDefinition ('monolog.logger ' ));
7864 $ this ->assertTrue ($ container ->hasDefinition ('monolog.handler.custom ' ));
7965 $ this ->assertTrue ($ container ->hasDefinition ('monolog.handler.nested ' ));
@@ -275,18 +261,10 @@ public function testSocketHandler()
275261 $ this ->assertContains ('connection_string ' , $ e ->getMessage ());
276262 }
277263
278- $ container = $ this ->getContainer (
279- [
280- [
281- 'handlers ' => [
282- 'socket ' => [
264+ $ container = $ this ->getContainer ([['handlers ' => ['socket ' => [
283265 'type ' => 'socket ' , 'timeout ' => 1 , 'persistent ' => true ,
284266 'connection_string ' => 'localhost:50505 ' , 'connection_timeout ' => '0.6 '
285- ]
286- ]
287- ]
288- ]
289- );
267+ ]]]]);
290268 $ this ->assertTrue ($ container ->hasDefinition ('monolog.logger ' ));
291269 $ this ->assertTrue ($ container ->hasDefinition ('monolog.handler.socket ' ));
292270
@@ -297,8 +275,7 @@ public function testSocketHandler()
297275 $ handler = $ container ->getDefinition ('monolog.handler.socket ' );
298276 $ this ->assertDICDefinitionClass ($ handler , 'Monolog\Handler\SocketHandler ' );
299277 $ 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 ' )]);
302279 $ this ->assertDICDefinitionMethodCallAt (1 , $ handler , 'setTimeout ' , ['1 ' ]);
303280 $ this ->assertDICDefinitionMethodCallAt (2 , $ handler , 'setConnectionTimeout ' , ['0.6 ' ]);
304281 $ this ->assertDICDefinitionMethodCallAt (3 , $ handler , 'setPersistent ' , [true ]);
@@ -318,17 +295,9 @@ public function testRavenHandlerWhenADSNIsSpecified()
318295 {
319296 $ dsn = 'http://43f6017361224d098402974103bfc53d:a6a0538fc2934ba2bed32e08741b2cd3@marca.python.live.cheggnet.com:9000/1 ' ;
320297
321- $ container = $ this ->getContainer (
322- [
323- [
324- 'handlers ' => [
325- 'raven ' => [
298+ $ container = $ this ->getContainer ([['handlers ' => ['raven ' => [
326299 'type ' => 'raven ' , 'dsn ' => $ dsn
327- ]
328- ]
329- ]
330- ]
331- );
300+ ]]]]);
332301 $ this ->assertTrue ($ container ->hasDefinition ('monolog.logger ' ));
333302 $ this ->assertTrue ($ container ->hasDefinition ('monolog.handler.raven ' ));
334303
@@ -344,17 +313,9 @@ public function testRavenHandlerWhenADSNIsSpecified()
344313
345314 public function testRavenHandlerWhenADSNAndAClientAreSpecified ()
346315 {
347- $ container = $ this ->getContainer (
348- [
349- [
350- 'handlers ' => [
351- 'raven ' => [
316+ $ container = $ this ->getContainer ([['handlers ' => ['raven ' => [
352317 'type ' => 'raven ' , 'dsn ' => 'foobar ' , 'client_id ' => 'raven.client '
353- ]
354- ]
355- ]
356- ]
357- );
318+ ]]]]);
358319
359320 $ this ->assertFalse ($ container ->hasDefinition ('raven.client ' ));
360321
@@ -368,17 +329,9 @@ public function testRavenHandlerWhenADSNAndAClientAreSpecified()
368329
369330 public function testRavenHandlerWhenAClientIsSpecified ()
370331 {
371- $ container = $ this ->getContainer (
372- [
373- [
374- 'handlers ' => [
375- 'raven ' => [
332+ $ container = $ this ->getContainer ([['handlers ' => ['raven ' => [
376333 'type ' => 'raven ' , 'client_id ' => 'raven.client '
377- ]
378- ]
379- ]
380- ]
381- );
334+ ]]]]);
382335
383336 $ this ->assertFalse ($ container ->hasDefinition ('raven.client ' ));
384337
@@ -404,17 +357,9 @@ public function testSentryHandlerWhenADSNIsSpecified()
404357 {
405358 $ dsn = 'http://43f6017361224d098402974103bfc53d:a6a0538fc2934ba2bed32e08741b2cd3@marca.python.live.cheggnet.com:9000/1 ' ;
406359
407- $ container = $ this ->getContainer (
408- [
409- [
410- 'handlers ' => [
411- 'sentry ' => [
360+ $ container = $ this ->getContainer ([['handlers ' => ['sentry ' => [
412361 'type ' => 'sentry ' , 'dsn ' => $ dsn
413- ]
414- ]
415- ]
416- ]
417- );
362+ ]]]]);
418363 $ this ->assertTrue ($ container ->hasDefinition ('monolog.logger ' ));
419364 $ this ->assertTrue ($ container ->hasDefinition ('monolog.handler.sentry ' ));
420365
@@ -491,33 +436,17 @@ public function testLogglyHandler()
491436 }
492437
493438 try {
494- $ this ->getContainer (
495- [
496- [
497- 'handlers ' => [
498- 'loggly ' => [
439+ $ this ->getContainer ([['handlers ' => ['loggly ' => [
499440 'type ' => 'loggly ' , 'token ' => $ token , 'tags ' => 'x, 1zone ,www.loggly.com,-us,apache$ '
500- ]
501- ]
502- ]
503- ]
504- );
441+ ]]]]);
505442 $ this ->fail ();
506443 } catch (InvalidConfigurationException $ e ) {
507444 $ this ->assertContains ('-us, apache$ ' , $ e ->getMessage ());
508445 }
509446
510- $ container = $ this ->getContainer (
511- [
512- [
513- 'handlers ' => [
514- 'loggly ' => [
447+ $ container = $ this ->getContainer ([['handlers ' => ['loggly ' => [
515448 'type ' => 'loggly ' , 'token ' => $ token
516- ]
517- ]
518- ]
519- ]
520- );
449+ ]]]]);
521450 $ this ->assertTrue ($ container ->hasDefinition ('monolog.logger ' ));
522451 $ this ->assertTrue ($ container ->hasDefinition ('monolog.handler.loggly ' ));
523452
@@ -530,17 +459,9 @@ public function testLogglyHandler()
530459 $ this ->assertDICDefinitionMethodCallAt (0 , $ handler , 'pushProcessor ' , [new Reference ('monolog.processor.psr_log_message ' )]
531460 );
532461
533- $ container = $ this ->getContainer (
534- [
535- [
536- 'handlers ' => [
537- 'loggly ' => [
462+ $ container = $ this ->getContainer ([['handlers ' => ['loggly ' => [
538463 'type ' => 'loggly ' , 'token ' => $ token , 'tags ' => [' ' , 'foo ' , '' , 'bar ' ]
539- ]
540- ]
541- ]
542- ]
543- );
464+ ]]]]);
544465 $ handler = $ container ->getDefinition ('monolog.handler.loggly ' );
545466 $ this ->assertDICDefinitionMethodCallAt (0 , $ handler , 'pushProcessor ' , [new Reference ('monolog.processor.psr_log_message ' )]
546467 );
@@ -550,16 +471,10 @@ public function testLogglyHandler()
550471 /** @group legacy */
551472 public function testFingersCrossedHandlerWhenExcluded404sAreSpecified ()
552473 {
553- $ container = $ this ->getContainer (
554- [
555- [
556- 'handlers ' => [
474+ $ container = $ this ->getContainer ([['handlers ' => [
557475 'main ' => ['type ' => 'fingers_crossed ' , 'handler ' => 'nested ' , 'excluded_404s ' => ['^/foo ' , '^/bar ' ]],
558476 'nested ' => ['type ' => 'stream ' , 'path ' => '/tmp/symfony.log ' ]
559- ]
560- ]
561- ]
562- );
477+ ]]]);
563478
564479 $ this ->assertTrue ($ container ->hasDefinition ('monolog.logger ' ));
565480 $ this ->assertTrue ($ container ->hasDefinition ('monolog.handler.main ' ));
@@ -587,20 +502,14 @@ public function testFingersCrossedHandlerWhenExcludedHttpCodesAreSpecified()
587502 $ this ->markTestSkipped ('Symfony Monolog 4.1+ is needed. ' );
588503 }
589504
590- $ container = $ this ->getContainer (
591- [
592- [
593- 'handlers ' => [
505+ $ container = $ this ->getContainer ([['handlers ' => [
594506 'main ' => [
595507 'type ' => 'fingers_crossed ' ,
596508 'handler ' => 'nested ' ,
597509 'excluded_http_codes ' => [403 , 404 , [405 => ['^/foo ' , '^/bar ' ]]]
598510 ],
599511 'nested ' => ['type ' => 'stream ' , 'path ' => '/tmp/symfony.log ' ]
600- ]
601- ]
602- ]
603- );
512+ ]]]);
604513
605514 $ this ->assertTrue ($ container ->hasDefinition ('monolog.logger ' ));
606515 $ this ->assertTrue ($ container ->hasDefinition ('monolog.handler.main ' ));
0 commit comments