|
@@ -226,6 +226,24 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
|
|
|
$this->assertEquals(@json_encode([$resource]), $res);
|
|
$this->assertEquals(@json_encode([$resource]), $res);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public function testNormalizeHandleLargeArrays()
|
|
|
|
|
+ {
|
|
|
|
|
+ $formatter = new NormalizerFormatter();
|
|
|
|
|
+ $largeArray = range(1, 2000);
|
|
|
|
|
+
|
|
|
|
|
+ $res = $formatter->format(array(
|
|
|
|
|
+ 'level_name' => 'CRITICAL',
|
|
|
|
|
+ 'channel' => 'test',
|
|
|
|
|
+ 'message' => 'bar',
|
|
|
|
|
+ 'context' => array($largeArray),
|
|
|
|
|
+ 'datetime' => new \DateTime,
|
|
|
|
|
+ 'extra' => array(),
|
|
|
|
|
+ ));
|
|
|
|
|
+
|
|
|
|
|
+ $this->assertCount(1000, $res['context'][0]);
|
|
|
|
|
+ $this->assertEquals('Over 1000 items (2000 total), aborting normalization', $res['context'][0]['...']);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @expectedException RuntimeException
|
|
* @expectedException RuntimeException
|
|
|
*/
|
|
*/
|