Apr 9, 2023
0
Level 4
Laravel fakes and expectations
Bit of an academic question here but I've started to use expecations in my Pest tests rather than assertions. Mainly because I find them easier on the eye.
There's one small fly in the ointment though and that's Laravel's test fakes which don't actually return a value to write an expectation against.
For example, this is just a straight assertion that either succeds or fails ...
Notification::fake();
Notification::assertSentTo($user, SomeNotifacation::class);
Is there a way to test expecations against Laravel fakes that I don't know about?
Please or to participate in this conversation.