-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Incompatible with PHPUnit >= 10.3 #61
Comments
I have the same issue:
|
I was looking into this a bit and found out the following so far
Since the whole modification of default params in Invocation is already a hack (Invocation is internal, private E.g. I tried the following (only in the one place that broke a test for us!) and it seems to work private function removeDefaultArguments(Invocation $invocation, string $class)
{
$parameters = $invocation->parameters();
MockFunctionGenerator::removeDefaultArguments($parameters);
$returnTypePropertyReflection = new \ReflectionProperty(Invocation::class, 'returnType');
$returnTypePropertyReflection->setAccessible(true);
$invocation = new Invocation(
$invocation->className(),
$invocation->methodName(),
$parameters,
$returnTypePropertyReflection->getValue($invocation),
$invocation->object()
);
} |
@herndlm I was looking into it as well, and I have no solution yet. I am worried we might not have one, or we would need to came up with something else. Yes, this library hacks PHPUnits, and it's already so complex to support all PHPUnit versions. Thanks for investigation, I'll try to dig a bit more once I have a bit more time. Thanks again |
oh, right, and in my proposed fix I missed that the passed $invocation is not overwritten / returned, so It's not doing anything 🤦♂️ additionally (missed in the previous points):
|
I am facing the same issue :
The solution that worked for me is simply using Here are the necessary changes :
And
|
@MekkiLakhdher it does not seem to be working - see: #62 (commit: 1dfcf66) |
… the moment not working with phpunit 7.3 php-mock/php-mock-phpunit#61
php-mock/php-mock-phpunit#61 Triggers a ton of deprecation warning; update as soon as possible
nice, thx @marcoscoelho. I can finally merge this one :D |
Caused by making the
$properties
property read only: sebastianbergmann/phpunit@eb2d761The text was updated successfully, but these errors were encountered: