1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-29 11:26:09 +01:00

Simplified message levels

This commit is contained in:
Jordi Boggiano
2011-02-18 00:44:21 +01:00
parent 5411d236c1
commit 594ed9cdcb
5 changed files with 25 additions and 27 deletions

View File

@@ -19,26 +19,26 @@ class LogTest extends \PHPUnit_Framework_TestCase
$writer1 = $this->getMock('Monolog\Writer\NullWriter', array('write'));
$writer1->expects($this->once())
->method('write')
->with('bob', Logger::WARN, 'test');
->with('bob', Logger::WARNING, 'test');
$writer2 = $this->getMock('Monolog\Writer\NullWriter', array('write'));
$writer2->expects($this->once())
->method('write')
->with('bob', Logger::WARN, 'test');
->with('bob', Logger::WARNING, 'test');
$logger->addWriter($writer1);
$logger->addWriter($writer2);
$logger->addMessage(Logger::WARN, 'test');
$logger->addMessage(Logger::WARNING, 'test');
}
public function testLogLowLevel()
{
$logger = new Log('bob');
$logger->setLevel(Logger::FATAL);
$this->assertEquals(Logger::FATAL, $logger->getLevel());
$logger->setLevel(Logger::ERROR);
$this->assertEquals(Logger::ERROR, $logger->getLevel());
$writer1 = $this->getMock('Monolog\Writer\NullWriter', array('write'));
$writer1->expects($this->never())
->method('write');
$logger->addWriter($writer1);
$logger->addMessage(Logger::WARN, 'test');
$logger->addMessage(Logger::WARNING, 'test');
}
}