Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Jan 25, 2024
1 parent 1062d6b commit 337da11
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
39 changes: 39 additions & 0 deletions tests/Http/ForgotPasswordControllerTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

Check warning on line 1 in tests/Http/ForgotPasswordControllerTest.php

View workflow job for this annotation

GitHub Actions / 4️⃣ Coding Standards

Found violation(s) of type: no_unused_imports

namespace Cone\Root\Tests\Http;

use Cone\Root\Tests\TestCase;
use Cone\Root\Tests\User;
use Illuminate\Auth\Events\Login;
use Illuminate\Auth\Events\Logout;
use Illuminate\Auth\Notifications\ResetPassword;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Notification;

class ForgotPasswordControllerTest extends TestCase
{
public function test_forgot_password_controller_shows_form(): void
{
$this->get('/root/password/reset')
->assertOk()
->assertViewIs('root::auth.forgot-password');
}

public function test_forgot_password_controller_handles_password_reset_request(): void
{
Notification::fake([ResetPassword::class]);

$this->post('/root/password/email')
->assertRedirect()
->assertSessionHasErrors(['email']);

$user = User::factory()->create();

$this->post('/root/password/email', [
'email' => $user->email,
])->assertRedirect()
->assertSessionDoesntHaveErrors();

Notification::assertNothingSentTo($user);
}
}
2 changes: 1 addition & 1 deletion tests/Http/LoginControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class LoginControllerTest extends TestCase
{
public function test_login_controller_shows_login_form(): void
public function test_login_controller_shows_form(): void
{
$this->get('/root/login')
->assertOk()
Expand Down

0 comments on commit 337da11

Please sign in to comment.