1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-21 20:35:17 +02:00

Convert level/levelName to enums (#1656)

This commit is contained in:
Jordi Boggiano
2022-04-19 21:49:03 +02:00
committed by GitHub
parent 248673e858
commit 2d006a8472
138 changed files with 1297 additions and 1216 deletions

View File

@@ -11,8 +11,8 @@
namespace Monolog\Handler;
use Monolog\Level;
use Monolog\Test\TestCase;
use Monolog\Logger;
/**
* @covers Monolog\Handler\TestHandler
@@ -22,7 +22,7 @@ class TestHandlerTest extends TestCase
/**
* @dataProvider methodProvider
*/
public function testHandler($method, $level)
public function testHandler($method, Level $level)
{
$handler = new TestHandler;
$record = $this->getRecord($level, 'test'.$method);
@@ -57,7 +57,7 @@ class TestHandlerTest extends TestCase
public function testHandlerAssertEmptyContext()
{
$handler = new TestHandler;
$record = $this->getRecord(Logger::WARNING, 'test', []);
$record = $this->getRecord(Level::Warning, 'test', []);
$this->assertFalse($handler->hasWarning([
'message' => 'test',
'context' => [],
@@ -80,7 +80,7 @@ class TestHandlerTest extends TestCase
public function testHandlerAssertNonEmptyContext()
{
$handler = new TestHandler;
$record = $this->getRecord(Logger::WARNING, 'test', ['foo' => 'bar']);
$record = $this->getRecord(Level::Warning, 'test', ['foo' => 'bar']);
$this->assertFalse($handler->hasWarning([
'message' => 'test',
'context' => [
@@ -105,14 +105,14 @@ class TestHandlerTest extends TestCase
public function methodProvider()
{
return [
['Emergency', Logger::EMERGENCY],
['Alert' , Logger::ALERT],
['Critical' , Logger::CRITICAL],
['Error' , Logger::ERROR],
['Warning' , Logger::WARNING],
['Info' , Logger::INFO],
['Notice' , Logger::NOTICE],
['Debug' , Logger::DEBUG],
['Emergency', Level::Emergency],
['Alert' , Level::Alert],
['Critical' , Level::Critical],
['Error' , Level::Error],
['Warning' , Level::Warning],
['Info' , Level::Info],
['Notice' , Level::Notice],
['Debug' , Level::Debug],
];
}
}