mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-04 20:27:31 +02:00
Added test, updated changelog
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
* Added ChromePHPHandler
|
||||
* Added MongoDBHandler
|
||||
* Added NormalizerFormatter
|
||||
* Added the possibility to change the activation strategy of the FingersCrossedHandler
|
||||
* Added possibility to show microseconds in logs
|
||||
* Added `server` and `referer` to WebProcessor output
|
||||
|
||||
|
@@ -13,6 +13,7 @@ namespace Monolog\Handler;
|
||||
|
||||
use Monolog\TestCase;
|
||||
use Monolog\Logger;
|
||||
use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy;
|
||||
|
||||
class FingersCrossedHandlerTest extends TestCase
|
||||
{
|
||||
@@ -133,4 +134,18 @@ class FingersCrossedHandlerTest extends TestCase
|
||||
$handler = new FingersCrossedHandler($test, Logger::ERROR);
|
||||
$this->assertTrue($handler->isHandling($this->getRecord(Logger::DEBUG)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Monolog\Handler\FingersCrossedHandler::__construct
|
||||
*/
|
||||
public function testActivationStrategy()
|
||||
{
|
||||
$test = new TestHandler();
|
||||
$handler = new FingersCrossedHandler($test, new ErrorLevelActivationStrategy(Logger::WARNING));
|
||||
$handler->handle($this->getRecord(Logger::DEBUG));
|
||||
$this->assertFalse($test->hasDebugRecords());
|
||||
$handler->handle($this->getRecord(Logger::WARNING));
|
||||
$this->assertTrue($test->hasDebugRecords());
|
||||
$this->assertTrue($test->hasWarningRecords());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user