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

Fix tests

This commit is contained in:
Jordi Boggiano
2016-05-27 13:56:49 +01:00
parent 21dde4dedb
commit 119807c80e
2 changed files with 6 additions and 6 deletions

View File

@@ -10,7 +10,7 @@ matrix:
fast_finish: true
before_script:
- echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo "extension = mongodb.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo "extension = amqp.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- if [ "$deps" == "low" ]; then composer update --prefer-source --prefer-lowest --prefer-stable; fi
- if [ "$deps" != "low" ]; then composer install --prefer-source; fi

View File

@@ -288,10 +288,10 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
$wrappedResource = new TestFooNorm;
$wrappedResource->foo = $resource;
// Just do something stupid with a resource/wrapped resource as argument
$arr = [$wrappedResource, null];
$arr = [$wrappedResource, $resource];
// modifying the array inside throws a "usort(): Array was modified by the user comparison function"
usort($arr, function ($a, $b) use (&$arr) {
$arr[] = 'new';
usort($arr, function ($a, $b) {
throw new \ErrorException('Foo');
});
} catch (\Throwable $e) {
}
@@ -301,11 +301,11 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
$result = $formatter->format($record);
$this->assertRegExp(
'%"resource":"\[resource\(stream\)\]"%',
'%\[resource\(stream\)\]%',
$result['context']['exception']['trace'][0]
);
$pattern = '%"wrappedResource":\{"Monolog\\\\\\\\Formatter\\\\\\\\TestFooNorm":"JSON_ERROR"\}%';
$pattern = '%\[\{"Monolog\\\\\\\\Formatter\\\\\\\\TestFooNorm":"JSON_ERROR"\}%';
// Tests that the wrapped resource is ignored while encoding, only works for PHP <= 5.4
$this->assertRegExp(