1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-05 04:37:38 +02:00

Use different testing pattern for PHP 5.4 and PHP 5.5

This commit is contained in:
Thomas Ploch
2014-12-16 13:46:06 +01:00
parent e66ba56cc0
commit 50b6bf45d1

View File

@@ -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]
);
}