|
|
@@ -303,6 +303,45 @@ class LoggerTest extends \PHPUnit_Framework_TestCase
|
|
|
$logger->debug('test');
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @covers Monolog\Logger::addRecord
|
|
|
+ */
|
|
|
+ public function testHandlersNotCalledBeforeFirstHandlingWithAssocArray()
|
|
|
+ {
|
|
|
+ $handler1 = $this->getMock('Monolog\Handler\HandlerInterface');
|
|
|
+ $handler1->expects($this->never())
|
|
|
+ ->method('isHandling')
|
|
|
+ ->will($this->returnValue(false))
|
|
|
+ ;
|
|
|
+ $handler1->expects($this->once())
|
|
|
+ ->method('handle')
|
|
|
+ ->will($this->returnValue(false))
|
|
|
+ ;
|
|
|
+
|
|
|
+ $handler2 = $this->getMock('Monolog\Handler\HandlerInterface');
|
|
|
+ $handler2->expects($this->once())
|
|
|
+ ->method('isHandling')
|
|
|
+ ->will($this->returnValue(true))
|
|
|
+ ;
|
|
|
+ $handler2->expects($this->once())
|
|
|
+ ->method('handle')
|
|
|
+ ->will($this->returnValue(false))
|
|
|
+ ;
|
|
|
+
|
|
|
+ $handler3 = $this->getMock('Monolog\Handler\HandlerInterface');
|
|
|
+ $handler3->expects($this->once())
|
|
|
+ ->method('isHandling')
|
|
|
+ ->will($this->returnValue(false))
|
|
|
+ ;
|
|
|
+ $handler3->expects($this->never())
|
|
|
+ ->method('handle')
|
|
|
+ ;
|
|
|
+
|
|
|
+ $logger = new Logger(__METHOD__, array('last' => $handler3, 'second' => $handler2, 'first' => $handler1));
|
|
|
+
|
|
|
+ $logger->debug('test');
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @covers Monolog\Logger::addRecord
|
|
|
*/
|