Open tuanpt-0634 opened 3 years ago
Heya, thanks for submitting this.
This seems like a feature request or an improvement so I'm moving this to the ideas repository instead. It's best to post these in the ideas repository in the future to get support for your idea. After that you may send a PR to the framework. Please only use the laravel/framework
issue tracker to report bugs and issues with the framework.
Thanks!
Thank you @driesvints
For this issue, I think option 2 is easiest way because Mockery is dependency of https://github.com/laravel/laravel Or integrate to framework to support several mock framework.
What do you think?
Version
Description:
Currently, when do mocking in a Feature test, for example:
If the mock expectation failed, because of default Exception handler, we will receive
$response
with status = 500 and PHPUnit output will be:It is hard to debug which causes test failed. Compare to mockery exception stack trace:
Solutions
There are serveral ways to improve this, but I am not sure should we integrate to framework. Please suggest, I can make a pull request.
Option 1: update default Exception hander:
Option 2: Update trait
tests/CreatesApplication.php
Option 3: update Laravel defaut test case
vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php
And bind new exception hander in this class.