1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-29 07:50:05 +02:00
This commit is contained in:
Jordi Boggiano
2016-09-25 17:46:38 +02:00
parent 941c21b793
commit 96f4fd718f
15 changed files with 39 additions and 36 deletions

View File

@@ -125,21 +125,22 @@ class JsonFormatterTest extends TestCase
}
/**
* @param JsonFormatter $formatter
* @param JsonFormatter $formatter
* @param \Exception|\Throwable $exception
*
* @return string
*/
private function formatRecordWithExceptionInContext(JsonFormatter $formatter, $exception)
{
$message = $formatter->format(array(
$message = $formatter->format([
'level_name' => 'CRITICAL',
'channel' => 'core',
'context' => array('exception' => $exception),
'context' => ['exception' => $exception],
'datetime' => null,
'extra' => array(),
'extra' => [],
'message' => 'foobar',
));
]);
return $message;
}

View File

@@ -93,14 +93,14 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
$formatter = new NormalizerFormatter('Y-m-d');
$e = new \SoapFault('foo', 'bar', 'hello', 'world');
$formatted = $formatter->format(array(
$formatted = $formatter->format([
'exception' => $e,
));
]);
unset($formatted['exception']['trace']);
$this->assertEquals(array(
'exception' => array(
$this->assertEquals([
'exception' => [
'class' => 'SoapFault',
'message' => 'bar',
'code' => 0,
@@ -108,8 +108,8 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
'faultcode' => 'foo',
'faultactor' => 'hello',
'detail' => 'world',
),
), $formatted);
],
], $formatted);
}
public function testFormatToStringExceptionHandle()