Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Nov 13, 2024
1 parent 0d947c0 commit 2e0f7f8
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
21 changes: 20 additions & 1 deletion tests/Actions/SendPasswordResetNotificationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,28 @@

namespace Cone\Root\Tests\Actions;

use Cone\Root\Actions\SendPasswordResetNotification;
use Cone\Root\Notifications\ResetPassword;
use Cone\Root\Tests\TestCase;
use Cone\Root\Tests\User;
use Illuminate\Support\Facades\Notification;

class SendPasswordResetNotificationTest extends TestCase
{
//
public function test_send_password_reset_notifications_action(): void
{
Notification::fake();

$action = new SendPasswordResetNotification;

$user = User::factory()->create();

$action->withQuery(fn () => User::query());

$this->app['request']->merge(['models' => [$user->getKey()]]);

$action->perform($this->app['request']);

Notification::assertNotSentTo($user, ResetPassword::class);
}
}
29 changes: 29 additions & 0 deletions tests/Actions/SendVerificaionNotificationTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

Check warning on line 1 in tests/Actions/SendVerificaionNotificationTest.php

View workflow job for this annotation

GitHub Actions / 文A Typos check

"Verificaion" should be "Verification".

namespace Cone\Root\Tests\Actions;

use Cone\Root\Actions\SendVerificationNotification;
use Cone\Root\Notifications\VerifyEmail;
use Cone\Root\Tests\TestCase;
use Cone\Root\Tests\User;
use Illuminate\Support\Facades\Notification;

class SendVerificaionNotificationTest extends TestCase

Check warning on line 11 in tests/Actions/SendVerificaionNotificationTest.php

View workflow job for this annotation

GitHub Actions / 文A Typos check

"Verificaion" should be "Verification".
{
public function test_send_verification_notifications_action(): void
{
Notification::fake();

$action = new SendVerificationNotification;

$user = User::factory()->create();

$action->withQuery(fn () => User::query());

$this->app['request']->merge(['models' => [$user->getKey()]]);

$action->perform($this->app['request']);

Notification::assertNotSentTo($user, VerifyEmail::class);
}
}

0 comments on commit 2e0f7f8

Please sign in to comment.