1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-11 15:44:34 +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

@@ -52,10 +52,10 @@ class JsonFormatterTest extends TestCase
public function testFormatBatch()
{
$formatter = new JsonFormatter();
$records = array(
$records = [
$this->getRecord(Logger::WARNING),
$this->getRecord(Logger::DEBUG),
);
];
$this->assertEquals(json_encode($records), $formatter->formatBatch($records));
}
@@ -66,10 +66,10 @@ class JsonFormatterTest extends TestCase
public function testFormatBatchNewlines()
{
$formatter = new JsonFormatter(JsonFormatter::BATCH_MODE_NEWLINES);
$records = $expected = array(
$records = $expected = [
$this->getRecord(Logger::WARNING),
$this->getRecord(Logger::DEBUG),
);
];
array_walk($expected, function (&$value, $key) {
$value = json_encode($value);
});
@@ -80,14 +80,14 @@ class JsonFormatterTest extends TestCase
{
$formatter = new JsonFormatter();
$exception = new \RuntimeException('Foo');
$message = $formatter->format(array(
$message = $formatter->format([
'level_name' => 'CRITICAL',
'channel' => 'core',
'context' => array('exception' => $exception),
'context' => ['exception' => $exception],
'datetime' => new \DateTimeImmutable(),
'extra' => array(),
'extra' => [],
'message' => 'foobar',
));
]);
if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
$path = substr(json_encode($exception->getFile(), JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 1, -1);
@@ -101,14 +101,14 @@ class JsonFormatterTest extends TestCase
{
$formatter = new JsonFormatter();
$exception = new \RuntimeException('Foo', 0, new \LogicException('Wut?'));
$message = $formatter->format(array(
$message = $formatter->format([
'level_name' => 'CRITICAL',
'channel' => 'core',
'context' => array('exception' => $exception),
'context' => ['exception' => $exception],
'datetime' => new \DateTimeImmutable(),
'extra' => array(),
'extra' => [],
'message' => 'foobar',
));
]);
if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
$pathPrevious = substr(json_encode($exception->getPrevious()->getFile(), JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 1, -1);