Skip to content

Conversation

@TavoNiievez
Copy link
Member

No description provided.

@DavertMik DavertMik merged commit 353189a into Codeception:master Dec 3, 2021
* @throws Throwable
*/
public function assertThrows($throws, callable $func, ...$params)
public function assertThrows($throws, callable $func, array $params = [])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might this be backward incompatible to many use cases? If any number of arguments are passed into a variable length argument list, PHP treats it as an array by default. How does this fix PHP 7.4 compatibility?

Wondering what this broke and why my team might need to update all of our tests... 😄

Would be happy to put in a PR to revert this, if that's acceptable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@boboudreau you can send a PR for this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have explicitly stated the issue; there are some tests in which we want to call a method with multiple arguments, but have passed them as the 4th, 5th, 6th, etc. argument to this method, and not as an array.

I see that this was at least versioned as 1.2 vs. 1.1 but generally there shouldn't be code changes that cause Errors that are Throwable (in this case, a TypeError) in a minor version release (according to semver), correct?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is correct, please include how you suggest your change be tagged in your PR description.

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

Successfully merging this pull request may close these issues.

3 participants