mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-09 22:56:41 +02:00
Add array of records to MailHandler::send to allow analysis of individual records before sending email
This commit is contained in:
@@ -61,9 +61,15 @@ class MailHandlerTest extends TestCase
|
||||
public function testHandle()
|
||||
{
|
||||
$handler = $this->getMockForAbstractClass('Monolog\\Handler\\MailHandler');
|
||||
$handler->expects($this->once())
|
||||
->method('send');
|
||||
|
||||
$handler->handle($this->getRecord());
|
||||
$record = $this->getRecord();
|
||||
$records = array($record);
|
||||
$records[0]['formatted'] = '['.$record['datetime']->format('Y-m-d H:i:s').'] test.WARNING: test [] []'."\n";
|
||||
|
||||
$handler->expects($this->once())
|
||||
->method('send')
|
||||
->with($records[0]['formatted'], $records);
|
||||
|
||||
$handler->handle($record);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user