]> git.mxchange.org Git - friendica.git/blobdiff - tests/src/Util/Logger/AbstractLoggerTest.php
Merge branch '2021.03-rc' into copyright-2021
[friendica.git] / tests / src / Util / Logger / AbstractLoggerTest.php
index 4879853281c2edd53fd65705bf07966927ada26d..396233306266605a62f7fe7630c3df140c808ace 100644 (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());
+       }
 }