1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-06 13:16:39 +02:00

Throw an exception on invalid level name

This commit is contained in:
Jordi Boggiano
2012-11-14 16:46:10 +01:00
parent bcb51e0140
commit b23cfd3d6c
2 changed files with 21 additions and 0 deletions

View File

@@ -25,6 +25,23 @@ class LoggerTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('foo', $logger->getName());
}
/**
* @covers Monolog\Logger::getLevelName
*/
public function testGetLevelName()
{
$this->assertEquals('ERROR', Logger::getLevelName(Logger::ERROR));
}
/**
* @covers Monolog\Logger::getLevelName
* @expectedException InvalidArgumentException
*/
public function testGetLevelNameThrows()
{
Logger::getLevelName(5);
}
/**
* @covers Monolog\Logger::__construct
*/