1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-03 19:57:41 +02:00

Add a record with an object as context

This commit is contained in:
George Mponos
2018-03-18 11:30:04 +02:00
committed by Jordi Boggiano
parent 20091d25d3
commit 68e39bd84f

View File

@@ -353,6 +353,14 @@ class SlackRecordTest extends TestCase
$this->assertSame($record['datetime']->getTimestamp(), $attachment['ts']);
}
public function testContextHasException()
{
$record = $this->getRecord(Logger::CRITICAL, 'This is a critical message.', array('exception' => new \Exception()));
$slackRecord = new SlackRecord(null, null, true, null, false, true);
$data = $slackRecord->getSlackData($record);
$this->assertInternalType('string', $data['attachments'][0]['fields'][1]['value']);
}
public function testExcludeExtraAndContextFields()
{
$record = $this->getRecord(