Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pact-PHP <=9.x.x - Various thoughts on the READme from a Pact and PHP newbie #208

Open
Grunet opened this issue Aug 15, 2021 · 0 comments
Open

Comments

@Grunet
Copy link

Grunet commented Aug 15, 2021

I tried using pact-php for the first time and ran into some difficulties getting things setup

TL;DR

I was tasked with migrating my work codebase off of Guzzle v3 and up to Guzzle v6, and eventually realized pact-php could help me do this safely by writing tests through Guzzle and mocking the API responses. For the moment I wasn't planning on using the provider/contract testing functionality.

As I was trying to get started using it (primarily via the READme) I ran into some difficulties, listed below in rough order of how confused I was when I encountered them

  1. The READme never mentions "HealthCheckTimeout" and "HealthCheckRetrySec", but both seem required to be set (via their setters) in order to avoid a type error (like "must be of the type int, null returned") when they're retrieved (this seems to be a new error as of PHP 7 maybe?). I also wasn't sure what their default values should be (ended up going with a max of 20 retries 1 second apart)
  2. Blindly copy-pasting snippets one after the other from the READme in the order they're presented eventually leads to a situation where the server was stopped, but an interaction is built afterwards. The error message that results didn't make it super clear to me what I had done wrong (I also hit this again when trying to create a reproduction for the first time)
  3. Some of the code snippets in the READme I was copy-pasting from don't include the relevant "use" directives, so once I realized the issue I had to go look in the linked example file to find them
  4. The "setCors" method included in the READme doesn't seem to do anything if it's unset, set to true, or set to false. Since there's no browser in play i was fairly confused about what this was for
  5. The "Build an Interaction" section of the READme includes a "given" method call that isn't present in the sample file

Let me know if I can help clarify any of this or if I should split things into individual issues.

Thank you all for your work on pact-php and for considering this feedback!

@YOU54F YOU54F changed the title Various thoughts on the READme from a Pact and PHP newbie Pact-PHP <=9.x.x : Various thoughts on the READme from a Pact and PHP newbie May 16, 2024
@YOU54F YOU54F changed the title Pact-PHP <=9.x.x : Various thoughts on the READme from a Pact and PHP newbie Pact-PHP <=9.x.x - Various thoughts on the READme from a Pact and PHP newbie May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant