first commit

This commit is contained in:
Noor E Ilahi
2026-01-09 12:54:53 +05:30
commit 7ccf44f7da
1070 changed files with 113036 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
<?php
namespace Tests\Feature\Auth\PasswordReset;
use App\Mail\ResetPassword;
use App\Models\User;
use Notification;
use Tests\Facades\UserFactory;
use Tests\TestCase;
class RequestTest extends TestCase
{
private const URI = 'auth/password/reset/request';
private User $user;
protected function setUp(): void
{
parent::setUp();
$this->user = UserFactory::create();
}
public function test_request(): void
{
Notification::fake();
Notification::assertNothingSent();
$response = $this->postJson(self::URI, ['email' => $this->user->email]);
$response->assertOk();
Notification::assertSentTo($this->user, ResetPassword::class);
}
public function test_wrong_email(): void
{
Notification::fake();
Notification::assertNothingSent();
$response = $this->postJson(self::URI, ['email' => 'wronemail@example.com']);
$response->assertNotFound('authorization.user_not_found');
Notification::assertNothingSent();
}
public function test_without_params(): void
{
Notification::fake();
Notification::assertNothingSent();
$response = $this->postJson(self::URI);
$response->assertError(self::HTTP_BAD_REQUEST);
Notification::assertNothingSent();
}
}