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

Fix compatibility with PHPUnit 10.4 #47

Merged

Conversation

W0rma
Copy link
Contributor

@W0rma W0rma commented Oct 6, 2023

Fixes #46

return self::doGenerateMock(func_get_args());
$args = func_get_args();
if (version_compare(PHPUnitVersion::series(), '10.4', '>=') && !is_bool($args[1])) {
array_splice($args, 1, 0, [true]);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

sebastianbergmann/phpunit@c8e2aa0 added a new parameter to Generator::testDouble()


// PHPUnit 10.4 changed method names
if (version_compare(PHPUnitVersion::series(), '10.4', '>=')) {
$methodName = $isAbstract ? 'mockObjectForAbstractClass' : 'testDouble';
Copy link
Contributor Author

@W0rma W0rma Oct 6, 2023

Choose a reason for hiding this comment

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

sebastianbergmann/phpunit@26a33f7 deprecated mockObjectForAbstractClass.
Seems like it will still be available in PHPUnit 11 but will be dropped in PHPUnit 12.

@W0rma W0rma marked this pull request as ready for review October 6, 2023 12:17
@Naktibalda Naktibalda merged commit f6bc56e into Codeception:master Oct 7, 2023
4 checks passed
@W0rma W0rma deleted the fix-compatibility-with-phpunit10-4 branch October 11, 2023 08:40
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.

Stub::make() seems to be broken when using PHPUnit 10.4
2 participants