Integrated
Integrated copied to clipboard
exception_message should be part of failure message
When I have a undefined variable in my view I get:
1) TaskManagementTest::addingATodo
A GET request to 'http://localhost' failed. Got a 500 code instead.
ErrorException on /home/username/todos/storage/framework/views/f8106f990a36ba68910cf43a05c14374 line 10
If I turn on the server and view the error in my browser, I get the useful information that is missing from the test failure message: Undefined variable: tassks (View: /home/username/todos/resources/views/tasks/index.blade.php)
I would think it would be a good idea to display the exception message in the failure output.
A possible change could be in LaravelTestCase.php in the handleInternalError method:
$error_message = $crawler->filter('.exception_message')->text(); // span tag that has message
// ...
$message .= "\n\n{$exception} on {$location}\n\n{$error_message}";
Thanks Timko
Submit a pull request so Jeffrey can take a look at it ;)