Fix object handling inside log arrays

This commit is contained in:
Philipp 2021-03-28 21:50:32 +02:00
parent cefeb02517
commit b61b3cb182
No known key found for this signature in database
GPG key ID: 9A28B7D4FF5667BD
4 changed files with 45 additions and 4 deletions

View file

@ -159,4 +159,23 @@ abstract class AbstractLoggerTest extends MockedTest
self::assertContains(@json_encode($context), $text);
}
/**
* Test a message with an exception
*/
public function testExceptionHandling()
{
$e = new \Exception("Test String", 123);
$eFollowUp = new \Exception("FollowUp", 456, $e);
$assertion = $eFollowUp->__toString();
$logger = $this->getInstance();
$logger->alert('test', ['e' => $eFollowUp]);
$text = $this->getContent();
self::assertLogline($text);
self::assertContains(@json_encode($assertion), $this->getContent());
}
}