1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-23 09:36:11 +02:00

Merge branch '1.x'

This commit is contained in:
Jordi Boggiano
2020-05-21 16:59:46 +02:00
6 changed files with 82 additions and 5 deletions

View File

@@ -87,7 +87,7 @@ class NormalizerFormatterTest extends TestCase
}
$formatter = new NormalizerFormatter('Y-m-d');
$e = new \SoapFault('foo', 'bar', 'hello', (object) ['foo' => 'world']);
$e = new \SoapFault('foo', 'bar', 'hello', 'world');
$formatted = $formatter->format([
'exception' => $e,
]);
@@ -105,6 +105,26 @@ class NormalizerFormatterTest extends TestCase
'detail' => 'world',
],
], $formatted);
$formatter = new NormalizerFormatter('Y-m-d');
$e = new \SoapFault('foo', 'bar', 'hello', (object) array('bar' => (object) array('biz' => 'baz'), 'foo' => 'world'));
$formatted = $formatter->format(array(
'exception' => $e,
));
unset($formatted['exception']['trace']);
$this->assertEquals(array(
'exception' => array(
'class' => 'SoapFault',
'message' => 'bar',
'code' => 0,
'file' => $e->getFile().':'.$e->getLine(),
'faultcode' => 'foo',
'faultactor' => 'hello',
'detail' => '{"bar":{"biz":"baz"},"foo":"world"}',
),
), $formatted);
}
public function testFormatToStringExceptionHandle()