Integrated icon indicating copy to clipboard operation
Integrated copied to clipboard

exception_message should be part of failure message

Open timkomip opened this issue 10 years ago • 1 comments

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

timkomip avatar May 09 '15 04:05 timkomip

Submit a pull request so Jeffrey can take a look at it ;)

bobbybouwmann avatar May 17 '15 12:05 bobbybouwmann