InaniELHoussain's avatar

Mockery TEST : Expected status code 200, got 500.

As the Title says I try to Test a Department's Controller and Actually I hade an issue :

  1. DepartmentTest::it_shows_all_the_departments Expected status code 200, got 500. Failed asserting that false is true.

C:\wamp\www\minisiga\vendor\laravel\framework\src\Illuminate\Foundation\Testing\AssertionsTrait.php:19 C:\wamp\www\minisiga\tests\unit\DepartmentTest.php:50

Here is my Test Class : http://pastebin.com/ntcd7Q2u Here is my Controller : http://pastebin.com/aD4tpeu3 and here is part of my route :

Route::group(['namespace' => 'Department'], function(){ Route::resource('department','ManageController'); });

I've been strugling with it for about 3 hours and I couldn't understand what did I wrong ...

Happy new Year

0 likes
1 reply
InaniELHoussain's avatar
Level 32

Solved, I just had to set the return of the mocked method ... since its needed in the code under test.

Please or to participate in this conversation.