Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix side effects in RequestHeadersConstraint #34

Merged

Conversation

MasonM
Copy link
Contributor

@MasonM MasonM commented Jun 13, 2017

The constructor in RequestHeadersConstraint takes in a array of header parameters from the Swagger definition and modifies them by calling unset($headerParameter->name); and unset($headerParameter->required);. This changes the definition and can cause subsequent assertions to fail.

The RequestQueryConstraint constructor calls $queryParameter = clone $queryParameter; to prevent this, so I just did the same here.

The constructor in RequestHeadersConstraint takes in a array of header
parameters from the Swagger definition and modifies them by calling
`unset($headerParameter->name);` and `unset($headerParameter->required);`.
This changes the definition and can cause subsequent assertions to fail.

The RequestQueryConstraint constructor calls
`$queryParameter = clone $queryParameter;` to prevent this, so I just did
the same here.
                                                                                                                                        ?>
@Maks3w
Copy link
Owner

Maks3w commented Jun 13, 2017

Thanks. Could you apply the same fix to RequestQueryConstraint?

@MasonM
Copy link
Contributor Author

MasonM commented Jun 13, 2017

@Maks3w Maks3w merged commit a41ec65 into Maks3w:master Jun 13, 2017
@Maks3w
Copy link
Owner

Maks3w commented Jun 13, 2017

released

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants