Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Jobs/PaymentMandateDisabledEmailTest.php
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | public function testHandle() | ||||
$job = new PaymentMandateDisabledEmail($wallet); | $job = new PaymentMandateDisabledEmail($wallet); | ||||
$job->handle(); | $job->handle(); | ||||
// Assert the email sending job was pushed once | // Assert the email sending job was pushed once | ||||
Mail::assertSent(PaymentMandateDisabled::class, 1); | Mail::assertSent(PaymentMandateDisabled::class, 1); | ||||
// Assert the mail was sent to the user's email | // Assert the mail was sent to the user's email | ||||
Mail::assertSent(PaymentMandateDisabled::class, function ($mail) use ($user) { | Mail::assertSent(PaymentMandateDisabled::class, function ($mail) { | ||||
return $mail->hasTo($user->email) && $mail->hasCc('ext@email.tld'); | return $mail->hasTo('ext@email.tld') && !$mail->hasCc('ext@email.tld'); | ||||
}); | }); | ||||
} | } | ||||
} | } |