Files
shipping-portal/tests/Unit/PasswordRestTest.php
T

47 lines
1.2 KiB
PHP

<?php
namespace Tests\Unit;
use App\Classes\Modules\Accounts\Services\ExpiresPasswordReset;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Queue;
use Tests\TestCase;
class PasswordRestTest extends TestCase
{
use RefreshDatabase;
public function test_generate_reset_password()
{
$user = User::factory()->create();
$response = $this->actingAs($user)->post('api/v1/account/authentication/password/forget', [
'email' => $user->email
]);
$response->assertStatus(200)
->assertSee("Reset Password Successful")
->assertSee("You have successfully sent you an email to reset your password");
//assert a reset data was saved in the database
$this->assertDatabaseHas('password_resets', [
'user_id' => $user->id,
]);
//todo register all classes in the IOC
//assert a verification Link was generated
// Queue::assertDispatched(ProcessImage::class, function ($job) {
// return $job->image === 'image.jpg';
// });
//get the token and pass it on the verification link
}
}