mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-05 12:47:39 +02:00
Merge pull request #1402 from dmaicher/issue-1401
FilterHandler: fix handle empty batch of filtered records
This commit is contained in:
@@ -128,8 +128,10 @@ class FilterHandler extends AbstractHandler
|
||||
}
|
||||
}
|
||||
|
||||
if (count($filtered) > 0) {
|
||||
$this->getHandler($filtered[count($filtered) - 1])->handleBatch($filtered);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the nested handler
|
||||
|
@@ -167,4 +167,12 @@ class FilterHandlerTest extends TestCase
|
||||
);
|
||||
$handler->handle($this->getRecord(Logger::WARNING));
|
||||
}
|
||||
|
||||
public function testHandleEmptyBatch()
|
||||
{
|
||||
$test = new TestHandler();
|
||||
$handler = new FilterHandler($test);
|
||||
$handler->handleBatch(array());
|
||||
$this->assertSame(array(), $test->getRecords());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user