mirror of
https://github.com/Seldaek/monolog.git
synced 2025-07-31 02:10:22 +02:00
Removed Logger::toMonologLevel() code duplication and added relevant tests
This commit is contained in:
@@ -33,6 +33,21 @@ class LoggerTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('ERROR', Logger::getLevelName(Logger::ERROR));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Monolog\Logger::toMonologLevel
|
||||
*/
|
||||
public function testConvertPSR3ToMonologLevel()
|
||||
{
|
||||
$this->assertEquals(Logger::toMonologLevel('debug'), 100);
|
||||
$this->assertEquals(Logger::toMonologLevel('info'), 200);
|
||||
$this->assertEquals(Logger::toMonologLevel('notice'), 250);
|
||||
$this->assertEquals(Logger::toMonologLevel('warning'), 300);
|
||||
$this->assertEquals(Logger::toMonologLevel('error'), 400);
|
||||
$this->assertEquals(Logger::toMonologLevel('critical'), 500);
|
||||
$this->assertEquals(Logger::toMonologLevel('alert'), 550);
|
||||
$this->assertEquals(Logger::toMonologLevel('emergency'), 600);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Monolog\Logger::getLevelName
|
||||
* @expectedException InvalidArgumentException
|
||||
|
Reference in New Issue
Block a user