Summer Sale! All accounts are 50% off this week.

normykinz's avatar

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?

0 likes
0 replies

Please or to participate in this conversation.