From 50b6bf45d1a5c17beaebd2aa95f552a8f2e7aec0 Mon Sep 17 00:00:00 2001 From: Thomas Ploch Date: Tue, 16 Dec 2014 13:46:06 +0100 Subject: [PATCH] Use different testing pattern for PHP 5.4 and PHP 5.5 --- tests/Monolog/Formatter/NormalizerFormatterTest.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/Monolog/Formatter/NormalizerFormatterTest.php b/tests/Monolog/Formatter/NormalizerFormatterTest.php index 0da32ca7..859fe25d 100644 --- a/tests/Monolog/Formatter/NormalizerFormatterTest.php +++ b/tests/Monolog/Formatter/NormalizerFormatterTest.php @@ -199,9 +199,15 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase $result['context']['exception']['trace'][0] ); - // Tests that the wrapped resource is ignored while encoding + if (version_compare(PHP_VERSION, '5.5.0', '>=')) { + $pattern = '%"wrappedResource":"\[object\] \(Monolog\\\\\\\\Formatter\\\\\\\\TestStreamFoo: \)"%'; + } else { + $pattern = '%\\\\"resource\\\\":null%'; + } + + // Tests that the wrapped resource is ignored while encoding, only works for PHP <= 5.4 $this->assertRegExp( - '%\\\\"resource\\\\":null%', + $pattern, $result['context']['exception']['trace'][0] ); }