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:
@@ -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
|
||||
|
Reference in New Issue
Block a user