mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-06 05:07:36 +02:00
Add a test that verifies manual overriding of activation strategy works
This commit is contained in:
@@ -173,6 +173,22 @@ class FingersCrossedHandlerTest extends TestCase
|
||||
$this->assertTrue($test->hasWarningRecords());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Monolog\Handler\FingersCrossedHandler::__construct
|
||||
* @covers Monolog\Handler\FingersCrossedHandler::activate
|
||||
*/
|
||||
public function testOverrideActivationStrategy()
|
||||
{
|
||||
$test = new TestHandler();
|
||||
$handler = new FingersCrossedHandler($test, new ErrorLevelActivationStrategy('warning'));
|
||||
$handler->handle($this->getRecord(Logger::DEBUG));
|
||||
$this->assertFalse($test->hasDebugRecords());
|
||||
$handler->activate();
|
||||
$handler->handle($this->getRecord(Logger::INFO));
|
||||
$this->assertTrue($test->hasDebugRecords());
|
||||
$this->assertTrue($test->hasInfoRecords());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Monolog\Handler\FingersCrossed\ChannelLevelActivationStrategy::__construct
|
||||
* @covers Monolog\Handler\FingersCrossed\ChannelLevelActivationStrategy::isHandlerActivated
|
||||
|
Reference in New Issue
Block a user