mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-22 00:56:08 +02:00
Tested the TestHandler (WTF)
This commit is contained in:
@@ -90,15 +90,18 @@ class TestHandler extends AbstractProcessingHandler
|
||||
return isset($this->recordsByLevel[Logger::DEBUG]);
|
||||
}
|
||||
|
||||
protected function hasRecord($record, $level = null)
|
||||
protected function hasRecord($record, $level)
|
||||
{
|
||||
if (null === $level) {
|
||||
$records = $this->records;
|
||||
} else {
|
||||
$records = $this->recordsByLevel[$level];
|
||||
if (!isset($this->recordsByLevel[$level])) {
|
||||
return false;
|
||||
}
|
||||
foreach ($records as $msg) {
|
||||
if ($msg['message'] === $record) {
|
||||
|
||||
if (is_array($record)) {
|
||||
$record = $record['message'];
|
||||
}
|
||||
|
||||
foreach ($this->recordsByLevel[$level] as $rec) {
|
||||
if ($rec['message'] === $record) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user