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

Merge pull request #808 from naderman/fix/normalizer-recusion

Normalization of arrays containing self references
This commit is contained in:
Jordi Boggiano
2016-07-02 15:34:40 +02:00
committed by GitHub
4 changed files with 23 additions and 6 deletions

View File

@@ -166,6 +166,15 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(@json_encode([$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