public getErrorMessage ( ) : string | ||
return | string | Error string based on the error object |
public function getErrorMessage()
{
$error = $this->getError();
if (!is_string($error)) {
$error = json_encode($error);
}
return $error;
}
/** * @group unit */ public function testStringErrorMessage() { $response = new Response(json_encode(array('error' => 'a'))); $this->assertEquals('a', $response->getErrorMessage()); }