renderException() публичный Метод

public renderException ( $message, Exception | Throwable $exception ) : string
$message
$exception Exception | Throwable
Результат string
Пример #1
0
 public function test_renderException_shouldRemoveWhitespace()
 {
     $response = $this->jsonBuilder->renderException("The\nerror\r\nmessage", new \Exception());
     $this->assertEquals('{"result":"error","message":"Theerrormessage"}', $response);
     $this->assertEquals((array) array('result' => 'error', 'message' => 'Theerrormessage'), json_decode($response, true));
     $this->assertNoJsonError($response);
 }