1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-04 12:17:35 +02:00

Added test, updated changelog

This commit is contained in:
Jordi Boggiano
2012-04-22 12:46:58 +02:00
parent 4d4a168716
commit 908d7734e7
2 changed files with 16 additions and 0 deletions

View File

@@ -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

View File

@@ -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());
}
}