Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Jobs/SignupVerificationEmailTest.php
Show All 16 Lines | class SignupVerificationEmailTest extends TestCase | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
public function setUp(): void | public function setUp(): void | ||||
{ | { | ||||
parent::setUp(); | parent::setUp(); | ||||
$this->code = SignupCode::create([ | $this->code = SignupCode::create([ | ||||
'data' => [ | |||||
'email' => 'SignupVerificationEmailTest1@' . \config('app.domain'), | 'email' => 'SignupVerificationEmailTest1@' . \config('app.domain'), | ||||
'first_name' => "Test", | 'first_name' => "Test", | ||||
'last_name' => "Job" | 'last_name' => "Job" | ||||
] | |||||
]); | ]); | ||||
} | } | ||||
/** | /** | ||||
* {@inheritDoc} | * {@inheritDoc} | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
Show All 17 Lines | public function testSignupVerificationEmailHandle() | ||||
$job = new SignupVerificationEmail($this->code); | $job = new SignupVerificationEmail($this->code); | ||||
$job->handle(); | $job->handle(); | ||||
// Assert the email sending job was pushed once | // Assert the email sending job was pushed once | ||||
Mail::assertSent(SignupVerification::class, 1); | Mail::assertSent(SignupVerification::class, 1); | ||||
// Assert the mail was sent to the code's email | // Assert the mail was sent to the code's email | ||||
Mail::assertSent(SignupVerification::class, function ($mail) { | Mail::assertSent(SignupVerification::class, function ($mail) { | ||||
return $mail->hasTo($this->code->data['email']); | return $mail->hasTo($this->code->email); | ||||
}); | }); | ||||
} | } | ||||
} | } |