|
|
@@ -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()
|