Closed tienvx closed 8 months ago
@tienvx hi, I'm just trying this, but how can your example work as newInteraction()
returns void
?
Will leave this to Tien to answer, but nice to see you 'round these parts again Artur!
Yea, I'm around again because I'm currently updating pact-php from 7.1 to 10.0.0-beta2 because I need tests where APIs return real binary data not just JSON.
That is all solved and also newInteraction()
works. Just need to do:
$builder->newInteraction();
$builder
->uponReceiving('a POST request to renew token')
...
and every interaction, except of the last one, needs false
in the second parameter of willRespondWith
see:
https://github.com/nextcloud/integration_openproject/pull/666
Maybe I will find time to document that
The documentation is in https://github.com/pact-foundation/pact-php/pull/620 please review
And thank-you for this great feature! I really should not have started with complains
InteractionBuilderTest
to unit tests with mocksThis is how end-user use it:
If not using this feature (nothing change):