Level 41
Can you show the code in that RequestClientSignatureEmail class?
Summer Sale! All accounts are 50% off this week.
I am at a loss for something apparently quite obvious. I am testing a Notification class to ensure it sends a Mail message, which is not queued.
My Event/Listener pubsub triggers Notification, Notification sends a Mailable.
/** @test */
public function it_will_handle_signed_event_with_countersigner()
{
Notification::fake();
$model = $this->factory(Contract::class)
->signed()
->withCountersigner()
->create();
$event = new Signed($model);
$listener = new SignedListener();
$listener->handle($event);
Notification::assertSentTo(
$model->countersigner,
RequestClientSignatureNotification::class
);
}
/** @test */
public function it_will_handle_request_client_signature_notification()
{
Mail::fake();
$profile = $this->factory(Profile::class)->create();
$contracts = Event::fakeFor(fn() =>
$this->factory(Contract::class)->signed()->for($profile, 'countersigner')->count(2)->create()
);
Notification::send($profile, new RequestClientSignatureNotification($contracts));
Mail::assertSent(RequestClientSignatureEmail::class);
}
but no matter how i try to test it, either via facad'ing though Notification (which I assume would be the proper way for the test) or via $profile->notify(..) or even with $notification->toMail(..) - in all cases it return false; with identical code run in tinker - it sure sends.
I am sure that I am missing something extremely obvious
Please or to participate in this conversation.