@@ -19,7 +19,7 @@ class LoggerDataCollectorTest extends \PHPUnit_Framework_TestCase
19
19
/**
20
20
* @dataProvider getCollectTestData
21
21
*/
22
- public function testCollect ($ nb , $ logs , $ expectedLogs , $ expectedDeprecationCount , $ expectedScreamCount )
22
+ public function testCollect ($ nb , $ logs , $ expectedLogs , $ expectedDeprecationCount , $ expectedScreamCount, $ expectedPriorities = null )
23
23
{
24
24
$ logger = $ this ->getMock ('Symfony\Component\HttpKernel\Log\DebugLoggerInterface ' );
25
25
$ logger ->expects ($ this ->once ())->method ('countErrors ' )->will ($ this ->returnValue ($ nb ));
@@ -33,42 +33,47 @@ public function testCollect($nb, $logs, $expectedLogs, $expectedDeprecationCount
33
33
$ this ->assertSame ($ expectedLogs ? $ expectedLogs : $ logs , $ c ->getLogs ());
34
34
$ this ->assertSame ($ expectedDeprecationCount , $ c ->countDeprecations ());
35
35
$ this ->assertSame ($ expectedScreamCount , $ c ->countScreams ());
36
+
37
+ if (isset ($ expectedPriorities )) {
38
+ $ this ->assertSame ($ expectedPriorities , $ c ->getPriorities ());
39
+ }
36
40
}
37
41
38
42
public function getCollectTestData ()
39
43
{
40
44
return array (
41
45
array (
42
46
1 ,
43
- array (array ('message ' => 'foo ' , 'context ' => array ())),
47
+ array (array ('message ' => 'foo ' , 'context ' => array (), ' priority ' => 100 , ' priorityName ' => ' DEBUG ' )),
44
48
null ,
45
49
0 ,
46
50
0 ,
47
51
),
48
52
array (
49
53
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 ' )),
52
56
0 ,
53
57
0 ,
54
58
),
55
59
array (
56
60
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 ' )),
59
63
0 ,
60
64
0 ,
61
65
),
62
66
array (
63
67
1 ,
64
68
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 ' ),
68
72
),
69
73
null ,
70
74
2 ,
71
75
1 ,
76
+ array (100 => array ('count ' => 3 , 'name ' => 'DEBUG ' )),
72
77
),
73
78
);
74
79
}
0 commit comments