31 $this->handler = $this->getMock(
'Monolog\\Handler\\HandlerInterface');
53 $this->handler->expects($this->
once())
54 ->method(
'isHandling')
58 $this->assertEquals(
$result, $this->wrapper->isHandling($record));
68 $this->handler->expects($this->
once())
73 $this->assertEquals(
$result, $this->wrapper->handle($record));
83 $this->handler->expects($this->
once())
84 ->method(
'handleBatch')
93 $processor =
function () {};
94 $this->handler->expects($this->
once())
95 ->method(
'pushProcessor')
98 $this->assertEquals($this->wrapper, $this->wrapper->pushProcessor($processor));
103 $processor =
function () {};
104 $this->handler->expects($this->
once())
105 ->method(
'popProcessor')
106 ->willReturn($processor);
108 $this->assertEquals($processor, $this->wrapper->popProcessor());
113 $formatter = $this->getMock(
'Monolog\\Formatter\\FormatterInterface');
114 $this->handler->expects($this->
once())
115 ->method(
'setFormatter')
118 $this->assertEquals($this->wrapper, $this->wrapper->setFormatter($formatter));
123 $formatter = $this->getMock(
'Monolog\\Formatter\\FormatterInterface');
124 $this->handler->expects($this->
once())
125 ->method(
'getFormatter')
126 ->willReturn($formatter);
128 $this->assertEquals($formatter, $this->wrapper->getFormatter());
getRecord($level=Logger::WARNING, $message='test', $context=array())
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.
This simple wrapper class can be used to extend handlers functionality.