hippo's avatar
Level 3

PHPUnit issues on example Feature Test

    /** @test */
    public function anyone_can_see_our_home_page()
    {
        //wtf
        $response = $this->get('/');
        $response->assertStatus(200);
    }

//gives me

There was 1 failure:

1) Tests\Feature\ServicesTest::anyone_can_see_our_home_page
Expected status code 200 but received 500.
Failed asserting that false is true.

I've obviously got a homepage. I don't know why this example test is not passing. I can view it in the browser with zero errors. Can I please get some help with where to go from here? I feel like these tests should be making this process easier, however I see literally no benefit yet. My php_errors.log has nothing new in it. I've used

php artisan cache:clear
composer dump-autoload

in hopes it'd help, but still nothing..

Thanks in advance for any pointers!

0 likes
2 replies
hippo's avatar
Level 3

config:clear helped me with my issues for anyone with similar problem.

steve_laracasts's avatar

I've been through exactly the same thing, 500 is internal server error, which means that your code is borked somewhere.

Try turning off exception handling:

$this->withoutExceptionHandling();

at the top of your test and you should get an error message that will help you debug.

Keep going, when the penny drops and it all starts working it is very good.

Please or to participate in this conversation.