mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-18 10:51:19 +02:00
Throw exception when json encoding fails and errors are not ignored, fixes #545
This commit is contained in:
@@ -174,6 +174,17 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(@json_encode(array($resource)), $res);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException RuntimeException
|
||||
*/
|
||||
public function testThrowsOnInvalidEncoding()
|
||||
{
|
||||
$formatter = new NormalizerFormatter();
|
||||
$reflMethod = new \ReflectionMethod($formatter, 'toJson');
|
||||
$reflMethod->setAccessible(true);
|
||||
$res = $reflMethod->invoke($formatter, array('message' => utf8_decode('öü')));
|
||||
}
|
||||
|
||||
public function testExceptionTraceWithArgs()
|
||||
{
|
||||
if (defined('HHVM_VERSION')) {
|
||||
|
Reference in New Issue
Block a user