Skip to content

Commit 2e0f7f8

Browse files
committed
wip
1 parent 0d947c0 commit 2e0f7f8

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

tests/Actions/SendPasswordResetNotificationTest.php

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,28 @@
22

33
namespace Cone\Root\Tests\Actions;
44

5+
use Cone\Root\Actions\SendPasswordResetNotification;
6+
use Cone\Root\Notifications\ResetPassword;
57
use Cone\Root\Tests\TestCase;
8+
use Cone\Root\Tests\User;
9+
use Illuminate\Support\Facades\Notification;
610

711
class 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
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
}

0 commit comments

Comments
 (0)