From e43a917b5488cfe018c51084772fe4c7cbaf753d Mon Sep 17 00:00:00 2001 From: Mohammad Alavi Date: Sat, 11 Dec 2021 13:46:07 +0330 Subject: [PATCH] add test --- .../Tests/Unit/VerifyEmailActionTest.php | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 app/Containers/AppSection/Authentication/Tests/Unit/VerifyEmailActionTest.php diff --git a/app/Containers/AppSection/Authentication/Tests/Unit/VerifyEmailActionTest.php b/app/Containers/AppSection/Authentication/Tests/Unit/VerifyEmailActionTest.php new file mode 100644 index 000000000..4ad69edc2 --- /dev/null +++ b/app/Containers/AppSection/Authentication/Tests/Unit/VerifyEmailActionTest.php @@ -0,0 +1,34 @@ +unverified()->create(); + // enable email verification + config(['appSection-authentication.require_email_verification' => true]); + $request = VerifyEmailRequest::injectData([], $unverifiedUser); + + + app(VerifyEmailAction::class)->run($request); + + $this->assertTrue($unverifiedUser->hasVerifiedEmail()); + Notification::assertSentTo($unverifiedUser, EmailVerified::class); + } +}