Update test for older versions of Laravel

This commit is contained in:
Amir Alizadeh
2025-05-14 19:38:26 +03:30
parent aba8e8c12b
commit a23f5053bd
@@ -51,7 +51,11 @@ it('can request password reset', function () {
);
Notification::assertSentTo($userToResetPassword, ResetPassword::class);
Event::assertDispatched(PasswordResetLinkSent::class, fn (PasswordResetLinkSent $event) => $event->user->is($userToResetPassword));
if (class_exists(PasswordResetLinkSent::class)) {
Event::assertDispatched(PasswordResetLinkSent::class, fn (PasswordResetLinkSent $event) => $event->user->is($userToResetPassword));
} else {
Event::assertNotDispatched(PasswordResetLinkSent::class);
}
});
it('cannot request password reset without panel access', function () {