Skip to content

Instantly share code, notes, and snippets.

@aaroncadrian
Last active March 7, 2018 21:41
Show Gist options
  • Save aaroncadrian/8f449e70f7e9584cd746707ed6595754 to your computer and use it in GitHub Desktop.
Save aaroncadrian/8f449e70f7e9584cd746707ed6595754 to your computer and use it in GitHub Desktop.
Method to disableExceptionHandling in tests so that you can fully inspect the error with phpunit.
protected function disableExceptionHandling()
{
$this->app->instance(\Illuminate\Contracts\Debug\ExceptionHandler::class, new class extends \App\Exceptions\Handler {
public function __construct() {}
public function report(\Exception $e) {}
public function render($request, \Exception $e)
{
throw $e;
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment