Support the ongoing development of Laravel.io →
posted 10 years ago
Testing

Hi there,

I am new to phpunit, watched a few videos about it and now I am trying to do a basic test on the create method of a SessionsController.

This method is basically returning a View containing a login form.

I simply want to start by testing that the page shows up but phpunit says my test is risky. Why is that?

Here is my test

public function test_sessions_create_page_displayed()
{
	$this->call('GET', 'sessions/create');
	$this->assertResponseOk();
}
Last updated 2 years ago.
0

Hi @bobwiley1991,

Do you have anything to share about this "risky warning" ? I do have the same issue and wonder why. Thanks a lot

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.