1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-10 15:14:14 +02:00
This commit is contained in:
Gyula Sallai
2011-04-28 18:02:38 +02:00
parent a1bc483041
commit d87ba1c6e5
3 changed files with 26 additions and 2 deletions

View File

@@ -37,6 +37,22 @@ class MailHandlerTest extends TestCase
$handler->handleBatch($records);
}
public function testHandleBatchNotSendsMailIfMessagesAreBelowLevel()
{
$records = array(
$this->getRecord(Logger::DEBUG, 'debug message 1'),
$this->getRecord(Logger::DEBUG, 'debug message 2'),
$this->getRecord(Logger::INFO, 'information'),
);
$handler = $this->getMockForAbstractClass('Monolog\\Handler\\MailHandler');
$handler->expects($this->never())
->method('send');
$handler->setLevel(Logger::ERROR);
$handler->handleBatch($records);
}
public function testHandle()
{
$record = $this->getRecord();