@@ -100,7 +100,7 @@ public function testHandleWithLogger($event, $event2)
100
100
}
101
101
102
102
$ this ->assertEquals (3 , $ logger ->countErrors ());
103
- $ logs = $ logger ->getLogs ('critical ' );
103
+ $ logs = $ logger ->getLogsForLevel ('critical ' );
104
104
$ this ->assertCount (3 , $ logs );
105
105
$ this ->assertStringStartsWith ('Uncaught PHP Exception Exception: "foo" at ErrorListenerTest.php line ' , $ logs [0 ]);
106
106
$ this ->assertStringStartsWith ('Uncaught PHP Exception Exception: "foo" at ErrorListenerTest.php line ' , $ logs [1 ]);
@@ -124,8 +124,8 @@ public function testHandleWithLoggerAndCustomConfiguration()
124
124
$ this ->assertEquals (new Response ('foo ' , 401 ), $ event ->getResponse ());
125
125
126
126
$ this ->assertEquals (0 , $ logger ->countErrors ());
127
- $ this ->assertCount (0 , $ logger ->getLogs ('critical ' ));
128
- $ this ->assertCount (1 , $ logger ->getLogs ('warning ' ));
127
+ $ this ->assertCount (0 , $ logger ->getLogsForLevel ('critical ' ));
128
+ $ this ->assertCount (1 , $ logger ->getLogsForLevel ('warning ' ));
129
129
}
130
130
131
131
public function testHandleWithLogLevelAttribute ()
@@ -139,8 +139,8 @@ public function testHandleWithLogLevelAttribute()
139
139
$ l ->onKernelException ($ event );
140
140
141
141
$ this ->assertEquals (0 , $ logger ->countErrors ());
142
- $ this ->assertCount (0 , $ logger ->getLogs ('critical ' ));
143
- $ this ->assertCount (1 , $ logger ->getLogs ('warning ' ));
142
+ $ this ->assertCount (0 , $ logger ->getLogsForLevel ('critical ' ));
143
+ $ this ->assertCount (1 , $ logger ->getLogsForLevel ('warning ' ));
144
144
}
145
145
146
146
public function testHandleClassImplementingInterfaceWithLogLevelAttribute ()
@@ -154,8 +154,8 @@ public function testHandleClassImplementingInterfaceWithLogLevelAttribute()
154
154
$ l ->onKernelException ($ event );
155
155
156
156
$ this ->assertEquals (0 , $ logger ->countErrors ());
157
- $ this ->assertCount (0 , $ logger ->getLogs ('critical ' ));
158
- $ this ->assertCount (1 , $ logger ->getLogs ('warning ' ));
157
+ $ this ->assertCount (0 , $ logger ->getLogsForLevel ('critical ' ));
158
+ $ this ->assertCount (1 , $ logger ->getLogsForLevel ('warning ' ));
159
159
}
160
160
161
161
public function testHandleWithLogLevelAttributeAndCustomConfiguration ()
@@ -173,8 +173,8 @@ public function testHandleWithLogLevelAttributeAndCustomConfiguration()
173
173
$ l ->onKernelException ($ event );
174
174
175
175
$ this ->assertEquals (0 , $ logger ->countErrors ());
176
- $ this ->assertCount (0 , $ logger ->getLogs ('warning ' ));
177
- $ this ->assertCount (1 , $ logger ->getLogs ('info ' ));
176
+ $ this ->assertCount (0 , $ logger ->getLogsForLevel ('warning ' ));
177
+ $ this ->assertCount (1 , $ logger ->getLogsForLevel ('info ' ));
178
178
}
179
179
180
180
/**
@@ -327,6 +327,11 @@ public function countErrors(?Request $request = null): int
327
327
{
328
328
return \count ($ this ->logs ['critical ' ]);
329
329
}
330
+
331
+ public function getLogs (?Request $ request = null ): array
332
+ {
333
+ return [];
334
+ }
330
335
}
331
336
332
337
class TestKernel implements HttpKernelInterface
0 commit comments