1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-08 22:26:41 +02:00

Refactored writeZendMonitorCustomEvent signature to provide better testability

This commit is contained in:
ChristianB
2013-01-30 21:42:59 +01:00
parent 4eb6011dc1
commit b4b2d91c67
2 changed files with 15 additions and 8 deletions

View File

@@ -39,12 +39,17 @@ class ZendMonitorHandlerTest extends TestCase
*/
public function testWrite()
{
$record = $this->getRecord();
$zendMonitor = $this->getMockBuilder('Monolog\Handler\ZendMonitorHandler')
->setMethods(array('writeZendMonitorCustomEvent'))
->getMock();
->setMethods(array('writeZendMonitorCustomEvent'))
->getMock();
$zendMonitor->expects($this->once())
->method('writeZendMonitorCustomEvent');
$zendMonitor->handle($this->getRecord());
->method('writeZendMonitorCustomEvent')
->with($record['level'], $record['message']);
$zendMonitor->handle($record);
}
}