mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-27 18:40:39 +00:00
added it_send_reset_password_for_user test
This commit is contained in:
@@ -5,13 +5,11 @@ namespace Tests\Feature;
|
||||
use App\Models\File;
|
||||
use App\Models\Setting;
|
||||
use App\Models\User;
|
||||
use Carbon\Carbon;
|
||||
use App\Notifications\ResetPassword;
|
||||
use DB;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Notification;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
use Stripe\Subscription;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminTest extends TestCase
|
||||
@@ -201,4 +199,25 @@ class AdminTest extends TestCase
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_send_reset_password_for_user()
|
||||
{
|
||||
Notification::fake();
|
||||
|
||||
$user = User::factory(User::class)
|
||||
->create(['role' => 'user']);
|
||||
|
||||
$admin = User::factory(User::class)
|
||||
->create(['role' => 'admin']);
|
||||
|
||||
Sanctum::actingAs($admin);
|
||||
|
||||
$this->postJson("/api/admin/users/$user->id/reset-password")
|
||||
->assertStatus(204);
|
||||
|
||||
Notification::assertTimesSent(1, ResetPassword::class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user