1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-06 05:07:36 +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:
Nils Adermann
2016-06-22 14:28:38 +02:00
parent 5f56ed5212
commit c582a6e791

View File

@@ -166,6 +166,15 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
$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()
{
// set up the recursion