Sep 10, 2015
0
Level 1
How to test exception
Hi I'm practicing unit tests with L5.1 and I do know how create a test for this:
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
{
if ($e instanceof ModelNotFoundException) {
$e = new NotFoundHttpException($e->getMessage(), $e);
}
return parent::render($request, $e);
}
I want create a test for IF part.
Can any help me?
Thank you for your time.
Please or to participate in this conversation.