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

Update test for 5.4/5.3

This commit is contained in:
Jordi Boggiano
2015-06-01 22:33:28 +01:00
parent b1afe75df9
commit 131b27d113

View File

@@ -190,7 +190,8 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
// This will contain $resource and $wrappedResource as arguments in the trace item // This will contain $resource and $wrappedResource as arguments in the trace item
$resource = fopen('php://memory', 'rw+'); $resource = fopen('php://memory', 'rw+');
fwrite($resource, 'test_resource'); fwrite($resource, 'test_resource');
$wrappedResource = new TestStreamFoo($resource); $wrappedResource = new TestFooNorm;
$wrappedResource->foo = $resource;
// Just do something stupid with a resource/wrapped resource as argument // Just do something stupid with a resource/wrapped resource as argument
array_keys($wrappedResource); array_keys($wrappedResource);
} catch (\Exception $e) { } catch (\Exception $e) {
@@ -207,9 +208,9 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
); );
if (version_compare(PHP_VERSION, '5.5.0', '>=')) { if (version_compare(PHP_VERSION, '5.5.0', '>=')) {
$pattern = '%"wrappedResource":"\[object\] \(Monolog\\\\\\\\Formatter\\\\\\\\TestStreamFoo: BAR - test_resource\)"%'; $pattern = '%"wrappedResource":"\[object\] \(Monolog\\\\\\\\Formatter\\\\\\\\TestFooNorm: \)"%';
} else { } else {
$pattern = '%\\\\"resource\\\\":null%'; $pattern = '%\\\\"foo\\\\":null%';
} }
// Tests that the wrapped resource is ignored while encoding, only works for PHP <= 5.4 // Tests that the wrapped resource is ignored while encoding, only works for PHP <= 5.4