1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-07-31 18:30:15 +02:00
This commit is contained in:
Jordi Boggiano
2016-05-26 20:54:06 +01:00
parent 85e43a5e7b
commit f200e79879
115 changed files with 1138 additions and 1123 deletions

View File

@@ -30,24 +30,24 @@ class ElasticaFormatterTest extends \PHPUnit_Framework_TestCase
public function testFormat()
{
// test log message
$msg = array(
$msg = [
'level' => Logger::ERROR,
'level_name' => 'ERROR',
'channel' => 'meh',
'context' => array('foo' => 7, 'bar', 'class' => new \stdClass),
'context' => ['foo' => 7, 'bar', 'class' => new \stdClass],
'datetime' => new \DateTimeImmutable("@0"),
'extra' => array(),
'extra' => [],
'message' => 'log',
);
];
// expected values
$expected = $msg;
$expected['datetime'] = '1970-01-01T00:00:00.000000+00:00';
$expected['context'] = array(
$expected['context'] = [
'class' => ['stdClass' => []],
'foo' => 7,
0 => 'bar',
);
];
// format log message
$formatter = new ElasticaFormatter('my_index', 'doc_type');