1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-07 05:36:45 +02:00

Merge branch '1.x'

This commit is contained in:
Jordi Boggiano
2019-12-20 14:53:43 +01:00
4 changed files with 28 additions and 14 deletions

View File

@@ -185,6 +185,14 @@ class JsonFormatterTest extends TestCase
);
}
public function testDefFormatWithResource()
{
$formatter = new JsonFormatter(JsonFormatter::BATCH_MODE_JSON, false);
$record = $this->getRecord();
$record['context'] = ['field_resource' => curl_init()];
$this->assertEquals('{"message":"test","context":{"field_resource":"[resource(curl)]"},"level":300,"level_name":"WARNING","channel":"test","datetime":"'.$record['datetime']->format('Y-m-d\TH:i:s.uP').'","extra":{}}', $formatter->format($record));
}
/**
* @param string $expected
* @param string $actual