Closed JuanRangel closed 7 years ago
Hey Juan
Are you using the disable exception handling technique that Adam went through earlier in the course. Ignore me if you are; I've not moved on to the 5.4 stuff yet.
Gary
Sent from my iPhone
On 9 Feb 2017, at 06:52, Juan Rangel notifications@github.com wrote:
I started the course when it was first launched but then left it alone for awhile. I get back and try to follow along with laravel 5.4. I've updated my app to Laravel 5.4 and everything is working fine, except the lack of feedback. Before in 5.3 when using $this->visit(); you would get exceptions such as SQLSTATE[HY000]: General error: 1 no such column:...., but we have now lost that little feedback when using $this-get();
When running a simple test like:
$task = factory(Task::class)->create();
$response = $this->get('/tasks/ . $tasks->id);
$response->assertStatus(200); $response->assertSee('A Sample Task'); Say for example I don't have a Task model. Before I would get an error of that model not existing, but now I simply get Expected status code 200 but received 500..
If I die and dump (dd($response->exception)) the response exception I can see the proper error, so I'm just wondering if there is a better way to get some feedback out of the box rather than creating my own solution?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Hey Juan,
feel free to browse though this issue https://github.com/laravel/framework/issues/17779. I have created it once I have started experiencing the same 'problems' as you do.
Thanks
Yeah try the disableExceptionHandling
technique, I have a dedicated video on it over at my blog:
https://adamwathan.me/2016/01/21/disabling-exception-handling-in-acceptance-tests/
I think that will sort you out 👍
Ahh. Thank you guys. I remeber @adamwathan mentioning it before somewhere in the course, but I restarted the course over and got to the 13th video and still couldn't figure it out.
For whatever reason I had to change $this->app->instance()
in the gist https://gist.github.com/adamwathan/c9752f61102dc056d157#file-1-testcase70-php
protected function disableExceptionHandling()
{
app()->instance(ExceptionHandler::class, new Class extends Handler
{
public function __construct(){}
public function report(Exception $exception){}
public function render($request, Exception $exception)
{
throw $exception;
}
});
}
Thanks again!
I started the course when it was first launched but then left it alone for awhile. I get back and try to follow along with laravel 5.4. I've updated my app to Laravel 5.4 and everything is working fine, except the lack of feedback. Before in 5.3 when using
$this->visit();
you would get exceptions such asSQLSTATE[HY000]: General error: 1 no such column:....
, but we have now lost that little feedback when using$this-get();
When running a simple test like:
Say for example I don't have a Task model. Before I would get an error of that model not existing, but now I simply get
Expected status code 200 but received 500.
.If I die and dump (
dd($response->exception)
) the response exception I can see the proper error, so I'm just wondering if there is a better way to get some feedback out of the box rather than creating my own solution?