forked from apiato/apiato
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d6e5587
commit c079e6d
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
app/Containers/AppSection/Authentication/Tests/Unit/SendVerificationEmailActionTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace App\Containers\AppSection\Authentication\Tests\Unit; | ||
|
||
use App\Containers\AppSection\Authentication\Actions\SendVerificationEmailAction; | ||
use App\Containers\AppSection\Authentication\Notifications\VerifyEmail; | ||
use App\Containers\AppSection\Authentication\Tests\TestCase; | ||
use App\Containers\AppSection\Authentication\UI\API\Requests\SendVerificationEmailRequest; | ||
use App\Containers\AppSection\User\Models\User; | ||
use Illuminate\Support\Facades\Notification; | ||
|
||
/** | ||
* Class SendVerificationEmailActionTest. | ||
* | ||
* @group authentication | ||
* @group unit | ||
*/ | ||
class SendVerificationEmailActionTest extends TestCase | ||
{ | ||
public function testSendVerificationEmailAction(): void | ||
{ | ||
Notification::fake(); | ||
$unverifiedUser = User::factory()->unverified()->create(); | ||
// enable email verification | ||
config(['appSection-authentication.require_email_verification' => true]); | ||
$request = SendVerificationEmailRequest::injectData([], $unverifiedUser); | ||
|
||
|
||
app(SendVerificationEmailAction::class)->run($request); | ||
|
||
Notification::assertSentTo($unverifiedUser, VerifyEmail::class); | ||
} | ||
} |