1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-16 01:54:19 +02:00

Fix Buffer, Group and FingersCrossed handlers to make use of their processors, fixes #170

This commit is contained in:
Jordi Boggiano
2013-03-17 19:36:02 +01:00
parent eaf2b07120
commit 5feb21ae1a
6 changed files with 73 additions and 0 deletions

View File

@@ -148,4 +148,22 @@ class FingersCrossedHandlerTest extends TestCase
$this->assertTrue($test->hasDebugRecords());
$this->assertTrue($test->hasWarningRecords());
}
/**
* @covers Monolog\Handler\FingersCrossedHandler::handle
*/
public function testHandleUsesProcessors()
{
$test = new TestHandler();
$handler = new FingersCrossedHandler($test, Logger::INFO);
$handler->pushProcessor(function ($record) {
$record['extra']['foo'] = true;
return $record;
});
$handler->handle($this->getRecord(Logger::WARNING));
$this->assertTrue($test->hasWarningRecords());
$records = $test->getRecords();
$this->assertTrue($records[0]['extra']['foo']);
}
}