mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-10 23:24:02 +02:00
Added test, updated changelog
This commit is contained in:
@@ -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