mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-06 13:16:39 +02:00
Add a test for references normalization
This is an issue in particular when $GLOBALS gets stuck into $context
This commit is contained in:
@@ -166,6 +166,15 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals(@json_encode(array($foo, $bar)), $res);
|
$this->assertEquals(@json_encode(array($foo, $bar)), $res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testCanNormalizeReferences()
|
||||||
|
{
|
||||||
|
$formatter = new NormalizerFormatter();
|
||||||
|
$x = ['foo' => 'bar'];
|
||||||
|
$y = ['x' => &$x];
|
||||||
|
$x['y'] = &$y;
|
||||||
|
$formatter->format($y);
|
||||||
|
}
|
||||||
|
|
||||||
public function testIgnoresInvalidTypes()
|
public function testIgnoresInvalidTypes()
|
||||||
{
|
{
|
||||||
// set up the recursion
|
// set up the recursion
|
||||||
|
Reference in New Issue
Block a user