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:
@@ -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
|
||||||
|
Reference in New Issue
Block a user