Replies: 1 comment
-
@divdax Hey. How about something like this? Saloon::fake([
FirstRequest::class => MockResponse::make(['foo' => 'bar']),
EventRequest::class => static function (PendingRequest $pendindRequest) {
static $eventId = 1;
return MockResponse::make(['event_id' => $eventId++]);
},
]) Untested, so it might not work. You may need to move the counter out of the Closure and use it as a reference. But basically; you can pass a callable as the value so you can handle different requests for the same request class. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey! 👋
I tried to test a service where I fire multiple
EventRequest
s. In the documentation, I found a sequence of requests, but I need to combine that with other requests besides theEventRequest
, like so:Do you maybe know a workaround to test a sequence of requests in this scenario?
Beta Was this translation helpful? Give feedback.
All reactions