1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-07-31 18:30:15 +02:00

Add isHandling, fixes #53

This commit is contained in:
Jordi Boggiano
2012-01-28 14:43:55 +01:00
parent 8e11234066
commit 355123d607
3 changed files with 60 additions and 0 deletions

View File

@@ -289,6 +289,32 @@ class LoggerTest extends \PHPUnit_Framework_TestCase
$logger->debug('test');
}
/**
* @covers Monolog\Logger::isHandling
*/
public function testIsHandling()
{
$logger = new Logger(__METHOD__);
$handler1 = $this->getMock('Monolog\Handler\HandlerInterface');
$handler1->expects($this->any())
->method('isHandling')
->will($this->returnValue(false))
;
$logger->pushHandler($handler1);
$this->assertFalse($logger->isHandling(Logger::DEBUG));
$handler2 = $this->getMock('Monolog\Handler\HandlerInterface');
$handler2->expects($this->any())
->method('isHandling')
->will($this->returnValue(true))
;
$logger->pushHandler($handler2);
$this->assertTrue($logger->isHandling(Logger::DEBUG));
}
/**
* @dataProvider logMethodProvider
* @covers Monolog\Logger::addDebug