1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-19 23:56:17 +02:00

Fix some issues, bump phpunit version

This commit is contained in:
Jordi Boggiano
2022-02-26 15:09:41 +01:00
parent 22c8b19358
commit 400effdd45
45 changed files with 602 additions and 774 deletions

View File

@@ -12,8 +12,9 @@
namespace Monolog\Formatter;
use Monolog\Logger;
use Monolog\Test\TestCase;
class ElasticsearchFormatterTest extends \PHPUnit\Framework\TestCase
class ElasticsearchFormatterTest extends TestCase
{
/**
* @covers Monolog\Formatter\ElasticsearchFormatter::__construct
@@ -23,18 +24,16 @@ class ElasticsearchFormatterTest extends \PHPUnit\Framework\TestCase
public function testFormat()
{
// Test log message
$msg = [
'level' => Logger::ERROR,
'level_name' => 'ERROR',
'channel' => 'meh',
'context' => ['foo' => 7, 'bar', 'class' => new \stdClass],
'datetime' => new \DateTimeImmutable("@0"),
'extra' => [],
'message' => 'log',
];
$msg = $this->getRecord(
Logger::ERROR,
'log',
channel: 'meh',
context: ['foo' => 7, 'bar', 'class' => new \stdClass],
datetime: new \DateTimeImmutable("@0"),
);
// Expected values
$expected = $msg;
$expected = $msg->toArray();
$expected['datetime'] = '1970-01-01T00:00:00+0000';
$expected['context'] = [
'class' => ['stdClass' => []],