Closed innocenzi closed 2 months ago
So I've been using automatic fixture generation to test integration with an API that returns a lot of data.
However, I find myself duplicating some fixtures to edit some information in them so my assertions can pass depending on what I send in the request.
Instead of doing that, it would be great to have the following API:
MockClient::global([ UpdateDealRequest::class => MockResponse::fixture('pipedrive/deal/update-16685-response', merge: [ 'status' => 'won' ]), ]);
The merge parameter would merge the array into the mocked response, so the following assertion would pass:
merge
expect($response->dto())->status->toBe(Status::WON);
I am totally open to PRing that, I created the issue to avoid working on it if it was not going to be accepted 👍
Ended up PRing anyway since the changes were relatively simple.
I'm going to close this as it's now a PR woo!
So I've been using automatic fixture generation to test integration with an API that returns a lot of data.
However, I find myself duplicating some fixtures to edit some information in them so my assertions can pass depending on what I send in the request.
Instead of doing that, it would be great to have the following API:
The
merge
parameter would merge the array into the mocked response, so the following assertion would pass:I am totally open to PRing that, I created the issue to avoid working on it if it was not going to be accepted 👍