public renderException ( $message, Exception | Throwable $exception ) : string | ||
$message | ||
$exception | Exception | Throwable | |
Результат | string |
public function renderException($message, $exception)
{
$message = array('result' => 'error', 'message' => $message);
return $this->serializeIfNeeded($message);
}
public function test_renderException_shouldReturnTheMessageAndNotTheExceptionMessage() { $response = $this->builder->renderException('This message should be ignored', new \BadMethodCallException('The other message')); $expected = array('result' => 'error', 'message' => 'This message should be ignored'); $this->assertEquals($expected, $response); }