File tree Expand file tree Collapse file tree 2 files changed +49
-1
lines changed
Expand file tree Collapse file tree 2 files changed +49
-1
lines changed Original file line number Diff line number Diff line change 22
33namespace Cone \Root \Tests \Actions ;
44
5+ use Cone \Root \Actions \SendPasswordResetNotification ;
6+ use Cone \Root \Notifications \ResetPassword ;
57use Cone \Root \Tests \TestCase ;
8+ use Cone \Root \Tests \User ;
9+ use Illuminate \Support \Facades \Notification ;
610
711class SendPasswordResetNotificationTest extends TestCase
812{
9- //
13+ public function test_send_password_reset_notifications_action (): void
14+ {
15+ Notification::fake ();
16+
17+ $ action = new SendPasswordResetNotification ;
18+
19+ $ user = User::factory ()->create ();
20+
21+ $ action ->withQuery (fn () => User::query ());
22+
23+ $ this ->app ['request ' ]->merge (['models ' => [$ user ->getKey ()]]);
24+
25+ $ action ->perform ($ this ->app ['request ' ]);
26+
27+ Notification::assertNotSentTo ($ user , ResetPassword::class);
28+ }
1029}
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Cone \Root \Tests \Actions ;
4+
5+ use Cone \Root \Actions \SendVerificationNotification ;
6+ use Cone \Root \Notifications \VerifyEmail ;
7+ use Cone \Root \Tests \TestCase ;
8+ use Cone \Root \Tests \User ;
9+ use Illuminate \Support \Facades \Notification ;
10+
11+ class SendVerificaionNotificationTest extends TestCase
12+ {
13+ public function test_send_verification_notifications_action (): void
14+ {
15+ Notification::fake ();
16+
17+ $ action = new SendVerificationNotification ;
18+
19+ $ user = User::factory ()->create ();
20+
21+ $ action ->withQuery (fn () => User::query ());
22+
23+ $ this ->app ['request ' ]->merge (['models ' => [$ user ->getKey ()]]);
24+
25+ $ action ->perform ($ this ->app ['request ' ]);
26+
27+ Notification::assertNotSentTo ($ user , VerifyEmail::class);
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments