From dccae6b8c04096e3ffa071326703e7fa0fd45ddb Mon Sep 17 00:00:00 2001 From: "Christopher C. Wells" Date: Mon, 29 Mar 2021 19:55:06 -0700 Subject: [PATCH] Move auth controller tests to namespace and refactor --- .../{ => Http/Controllers/Auth}/AuthenticationTest.php | 8 ++++---- .../Controllers/Auth}/EmailVerificationTest.php | 8 ++++---- .../Controllers/Auth}/PasswordConfirmationTest.php | 8 ++++---- .../{ => Http/Controllers/Auth}/PasswordResetTest.php | 10 +++++----- 4 files changed, 17 insertions(+), 17 deletions(-) rename tests/Feature/{ => Http/Controllers/Auth}/AuthenticationTest.php (77%) rename tests/Feature/{ => Http/Controllers/Auth}/EmailVerificationTest.php (87%) rename tests/Feature/{ => Http/Controllers/Auth}/PasswordConfirmationTest.php (78%) rename tests/Feature/{ => Http/Controllers/Auth}/PasswordResetTest.php (84%) diff --git a/tests/Feature/AuthenticationTest.php b/tests/Feature/Http/Controllers/Auth/AuthenticationTest.php similarity index 77% rename from tests/Feature/AuthenticationTest.php rename to tests/Feature/Http/Controllers/Auth/AuthenticationTest.php index 2dbceac..647cdba 100644 --- a/tests/Feature/AuthenticationTest.php +++ b/tests/Feature/Http/Controllers/Auth/AuthenticationTest.php @@ -1,6 +1,6 @@ get('/login'); $response->assertStatus(200); } - public function test_users_can_authenticate_using_the_login_screen() + public function testUsersCanAuthenticateUsingLoginScreen() { $user = User::factory()->create(); @@ -31,7 +31,7 @@ class AuthenticationTest extends TestCase $response->assertRedirect(RouteServiceProvider::HOME); } - public function test_users_can_not_authenticate_with_invalid_password() + public function testUsersCannotAuthenticateWithInvalidPassword() { $user = User::factory()->create(); diff --git a/tests/Feature/EmailVerificationTest.php b/tests/Feature/Http/Controllers/Auth/EmailVerificationTest.php similarity index 87% rename from tests/Feature/EmailVerificationTest.php rename to tests/Feature/Http/Controllers/Auth/EmailVerificationTest.php index 61b5775..8b0d885 100644 --- a/tests/Feature/EmailVerificationTest.php +++ b/tests/Feature/Http/Controllers/Auth/EmailVerificationTest.php @@ -1,6 +1,6 @@ create([ 'email_verified_at' => null, @@ -25,7 +25,7 @@ class EmailVerificationTest extends TestCase $response->assertStatus(200); } - public function test_email_can_be_verified() + public function testEmailCanBeVerified() { Event::fake(); @@ -46,7 +46,7 @@ class EmailVerificationTest extends TestCase $response->assertRedirect(RouteServiceProvider::HOME.'?verified=1'); } - public function test_email_is_not_verified_with_invalid_hash() + public function testEmailIsNotVerifiedWithInvalidHash() { $user = User::factory()->create([ 'email_verified_at' => null, diff --git a/tests/Feature/PasswordConfirmationTest.php b/tests/Feature/Http/Controllers/Auth/PasswordConfirmationTest.php similarity index 78% rename from tests/Feature/PasswordConfirmationTest.php rename to tests/Feature/Http/Controllers/Auth/PasswordConfirmationTest.php index fdfe630..289f503 100644 --- a/tests/Feature/PasswordConfirmationTest.php +++ b/tests/Feature/Http/Controllers/Auth/PasswordConfirmationTest.php @@ -1,6 +1,6 @@ create(); @@ -19,7 +19,7 @@ class PasswordConfirmationTest extends TestCase $response->assertStatus(200); } - public function test_password_can_be_confirmed() + public function testPasswordCanBeConfirmed() { $user = User::factory()->create(); @@ -31,7 +31,7 @@ class PasswordConfirmationTest extends TestCase $response->assertSessionHasNoErrors(); } - public function test_password_is_not_confirmed_with_invalid_password() + public function testPasswordIsNotConfirmedWithInvalidPassword() { $user = User::factory()->create(); diff --git a/tests/Feature/PasswordResetTest.php b/tests/Feature/Http/Controllers/Auth/PasswordResetTest.php similarity index 84% rename from tests/Feature/PasswordResetTest.php rename to tests/Feature/Http/Controllers/Auth/PasswordResetTest.php index 8d98149..908035f 100644 --- a/tests/Feature/PasswordResetTest.php +++ b/tests/Feature/Http/Controllers/Auth/PasswordResetTest.php @@ -1,6 +1,6 @@ get('/forgot-password'); $response->assertStatus(200); } - public function test_reset_password_link_can_be_requested() + public function testResetPasswordLinkCanBeRequested() { Notification::fake(); @@ -30,7 +30,7 @@ class PasswordResetTest extends TestCase Notification::assertSentTo($user, ResetPassword::class); } - public function test_reset_password_screen_can_be_rendered() + public function testResetPasswordScreenCanBeRendered() { Notification::fake(); @@ -47,7 +47,7 @@ class PasswordResetTest extends TestCase }); } - public function test_password_can_be_reset_with_valid_token() + public function testPasswordCanBeResetWithValidToken() { Notification::fake();