21 if (!function_exists(
'zend_monitor_custom_event')) {
22 $this->markTestSkipped(
'ZendServer is not installed');
32 $formatterResult =
array(
33 'message' => $record[
'message'],
36 $zendMonitor = $this->getMockBuilder(
'Monolog\Handler\ZendMonitorHandler')
37 ->setMethods(
array(
'writeZendMonitorCustomEvent',
'getDefaultFormatter'))
40 $formatterMock = $this->getMockBuilder(
'Monolog\Formatter\NormalizerFormatter')
41 ->disableOriginalConstructor()
44 $formatterMock->expects($this->once())
46 ->will($this->returnValue($formatterResult));
48 $zendMonitor->expects($this->once())
49 ->method(
'getDefaultFormatter')
50 ->will($this->returnValue($formatterMock));
52 $levelMap = $zendMonitor->getLevelMap();
54 $zendMonitor->expects($this->once())
55 ->method(
'writeZendMonitorCustomEvent')
56 ->with($levelMap[$record[
'level']], $record[
'message'], $formatterResult);
58 $zendMonitor->handle($record);
67 $this->assertInstanceOf(
'Monolog\Formatter\NormalizerFormatter', $zendMonitor->getDefaultFormatter());
getRecord($level=Logger::WARNING, $message='test', $context=array())
Create styles array
The data for the language used.
Handler sending logs to Zend Monitor.
testGetDefaultFormatterReturnsNormalizerFormatter()
Monolog::getDefaultFormatter
testWrite()
Monolog::write