@@ -19,7 +19,7 @@ class LoggerDataCollectorTest extends \PHPUnit_Framework_TestCase
1919 /**
2020 * @dataProvider getCollectTestData
2121 */
22- public function testCollect ($ nb , $ logs , $ expectedLogs , $ expectedDeprecationCount , $ expectedScreamCount )
22+ public function testCollect ($ nb , $ logs , $ expectedLogs , $ expectedDeprecationCount , $ expectedScreamCount, $ expectedPriorities = null )
2323 {
2424 $ logger = $ this ->getMock ('Symfony\Component\HttpKernel\Log\DebugLoggerInterface ' );
2525 $ logger ->expects ($ this ->once ())->method ('countErrors ' )->will ($ this ->returnValue ($ nb ));
@@ -33,42 +33,47 @@ public function testCollect($nb, $logs, $expectedLogs, $expectedDeprecationCount
3333 $ this ->assertSame ($ expectedLogs ? $ expectedLogs : $ logs , $ c ->getLogs ());
3434 $ this ->assertSame ($ expectedDeprecationCount , $ c ->countDeprecations ());
3535 $ this ->assertSame ($ expectedScreamCount , $ c ->countScreams ());
36+
37+ if (isset ($ expectedPriorities )) {
38+ $ this ->assertSame ($ expectedPriorities , $ c ->getPriorities ());
39+ }
3640 }
3741
3842 public function getCollectTestData ()
3943 {
4044 return array (
4145 array (
4246 1 ,
43- array (array ('message ' => 'foo ' , 'context ' => array ())),
47+ array (array ('message ' => 'foo ' , 'context ' => array (), ' priority ' => 100 , ' priorityName ' => ' DEBUG ' )),
4448 null ,
4549 0 ,
4650 0 ,
4751 ),
4852 array (
4953 1 ,
50- array (array ('message ' => 'foo ' , 'context ' => array ('foo ' => fopen (__FILE__ , 'r ' )))),
51- array (array ('message ' => 'foo ' , 'context ' => array ('foo ' => 'Resource(stream) ' ))),
54+ array (array ('message ' => 'foo ' , 'context ' => array ('foo ' => fopen (__FILE__ , 'r ' )), ' priority ' => 100 , ' priorityName ' => ' DEBUG ' )),
55+ array (array ('message ' => 'foo ' , 'context ' => array ('foo ' => 'Resource(stream) ' ), ' priority ' => 100 , ' priorityName ' => ' DEBUG ' )),
5256 0 ,
5357 0 ,
5458 ),
5559 array (
5660 1 ,
57- array (array ('message ' => 'foo ' , 'context ' => array ('foo ' => new \stdClass ()))),
58- array (array ('message ' => 'foo ' , 'context ' => array ('foo ' => 'Object(stdClass) ' ))),
61+ array (array ('message ' => 'foo ' , 'context ' => array ('foo ' => new \stdClass ()), ' priority ' => 100 , ' priorityName ' => ' DEBUG ' )),
62+ array (array ('message ' => 'foo ' , 'context ' => array ('foo ' => 'Object(stdClass) ' ), ' priority ' => 100 , ' priorityName ' => ' DEBUG ' )),
5963 0 ,
6064 0 ,
6165 ),
6266 array (
6367 1 ,
6468 array (
65- array ('message ' => 'foo ' , 'context ' => array ('type ' => ErrorHandler::TYPE_DEPRECATION )),
66- array ('message ' => 'foo2 ' , 'context ' => array ('type ' => ErrorHandler::TYPE_DEPRECATION )),
67- array ('message ' => 'foo3 ' , 'context ' => array ('type ' => E_USER_WARNING , 'scream ' => 0 )),
69+ array ('message ' => 'foo ' , 'context ' => array ('type ' => ErrorHandler::TYPE_DEPRECATION ), ' priority ' => 100 , ' priorityName ' => ' DEBUG ' ),
70+ array ('message ' => 'foo2 ' , 'context ' => array ('type ' => ErrorHandler::TYPE_DEPRECATION ), ' priority ' => 100 , ' priorityName ' => ' DEBUG ' ),
71+ array ('message ' => 'foo3 ' , 'context ' => array ('type ' => E_USER_WARNING , 'scream ' => 0 ), ' priority ' => 100 , ' priorityName ' => ' DEBUG ' ),
6872 ),
6973 null ,
7074 2 ,
7175 1 ,
76+ array (100 => array ('count ' => 3 , 'name ' => 'DEBUG ' )),
7277 ),
7378 );
7479 }
0 commit comments