1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-12 16:14:08 +02:00

Resolve json encoding errors issue globally, refs #137

This commit is contained in:
Jordi Boggiano
2013-01-06 20:14:14 +01:00
parent 271c396964
commit 63e3bfdf7e
5 changed files with 71 additions and 52 deletions

View File

@@ -108,41 +108,4 @@ class WildfireFormatterTest extends \PHPUnit_Framework_TestCase
$wildfire->formatBatch(array($record));
}
/**
* Test issue #137 (https://github.com/Seldaek/monolog/pull/137)
*/
public function testFormatWithObjectsInContext()
{
// Set up the recursion
$foo = new \stdClass();
$bar = new \stdClass();
$foo->bar = $bar;
$bar->foo = $foo;
$record = array(
'message' => "foo",
'level' => 300,
'channel' => 'foo',
'context' => array(
'stack' => array(
array($foo),
array($bar),
),
),
'extra' => array(),
);
// Set an error handler to assert that the error is not raised anymore
$that = $this;
set_error_handler(function ($level, $message, $file, $line, $context) use ($that) {
$that->fail("$message should not be raised anymore");
});
$wildfire = new WildfireFormatter();
$wildfire->format($record);
restore_error_handler();
}
}