From 558678b42080196ae14e6a8134978a9e475fb991 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sun, 12 Jul 2015 14:01:43 +0100 Subject: [PATCH] Adjust check for php5.3/5.4 --- tests/Monolog/Formatter/NormalizerFormatterTest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/Monolog/Formatter/NormalizerFormatterTest.php b/tests/Monolog/Formatter/NormalizerFormatterTest.php index 83c45ca6..095fb08e 100644 --- a/tests/Monolog/Formatter/NormalizerFormatterTest.php +++ b/tests/Monolog/Formatter/NormalizerFormatterTest.php @@ -182,7 +182,12 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase $formatter = new NormalizerFormatter(); $reflMethod = new \ReflectionMethod($formatter, 'toJson'); $reflMethod->setAccessible(true); - $res = $reflMethod->invoke($formatter, array('message' => utf8_decode('ΓΆΓΌ'))); + + // send an invalid unicode sequence + $res = $reflMethod->invoke($formatter, array('message' => "\xB1\x31")); + if (PHP_VERSION_ID < 50500 && $res === array('message' => null)) { + throw new \RuntimeException('PHP 5.3/5.4 throw a warning and null the value instead of returning false entirely'); + } } public function testExceptionTraceWithArgs()