1
0
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:
Jordi Boggiano
2011-06-29 20:38:15 +02:00
parent 8108272c6c
commit 7a56a1c73f
2 changed files with 64 additions and 7 deletions

View File

@@ -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;
}
}