mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-07 13:46:38 +02:00
Fix tests
This commit is contained in:
@@ -10,7 +10,7 @@ matrix:
|
|||||||
fast_finish: true
|
fast_finish: true
|
||||||
|
|
||||||
before_script:
|
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
|
- 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 update --prefer-source --prefer-lowest --prefer-stable; fi
|
||||||
- if [ "$deps" != "low" ]; then composer install --prefer-source; fi
|
- if [ "$deps" != "low" ]; then composer install --prefer-source; fi
|
||||||
|
@@ -288,10 +288,10 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
|
|||||||
$wrappedResource = new TestFooNorm;
|
$wrappedResource = new TestFooNorm;
|
||||||
$wrappedResource->foo = $resource;
|
$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
|
||||||
$arr = [$wrappedResource, null];
|
$arr = [$wrappedResource, $resource];
|
||||||
// modifying the array inside throws a "usort(): Array was modified by the user comparison function"
|
// modifying the array inside throws a "usort(): Array was modified by the user comparison function"
|
||||||
usort($arr, function ($a, $b) use (&$arr) {
|
usort($arr, function ($a, $b) {
|
||||||
$arr[] = 'new';
|
throw new \ErrorException('Foo');
|
||||||
});
|
});
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
}
|
}
|
||||||
@@ -301,11 +301,11 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
|
|||||||
$result = $formatter->format($record);
|
$result = $formatter->format($record);
|
||||||
|
|
||||||
$this->assertRegExp(
|
$this->assertRegExp(
|
||||||
'%"resource":"\[resource\(stream\)\]"%',
|
'%\[resource\(stream\)\]%',
|
||||||
$result['context']['exception']['trace'][0]
|
$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
|
// Tests that the wrapped resource is ignored while encoding, only works for PHP <= 5.4
|
||||||
$this->assertRegExp(
|
$this->assertRegExp(
|
||||||
|
Reference in New Issue
Block a user