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:
@@ -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' => []],
|
||||
|
Reference in New Issue
Block a user