-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Cannot double interfaces that declare a constructor with PHP 8 #4139
Labels
Comments
While PHPUnit is tested on PHP 8 in continuous integration, PHPUnit is not supported on PHP 8 yet. |
Code generated with PHP 7.4class Mock_I_abd6e555 implements PHPUnit\Framework\MockObject\MockObject, I
{
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;
use \PHPUnit\Framework\MockObject\MockedCloneMethod;
public function __construct()
{
$__phpunit_arguments = [];
$__phpunit_count = func_num_args();
if ($__phpunit_count > 0) {
$__phpunit_arguments_tmp = func_get_args();
for ($__phpunit_i = 0; $__phpunit_i < $__phpunit_count; $__phpunit_i++) {
$__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i];
}
}
$__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke(
new \PHPUnit\Framework\MockObject\Invocation(
'I', '__construct', $__phpunit_arguments, '', $this, false
)
);
return $__phpunit_result;
}
} Code generated with PHP 8.0class Mock_I_1b966968 implements PHPUnit\Framework\MockObject\MockObject, I
{
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;
use \PHPUnit\Framework\MockObject\MockedCloneMethod;
} TL;DR: The constructor is missing in the code generated with PHP 8. |
sebastianbergmann
changed the title
Can't mock interfaces with constructor on PHP 8
Cannot double interfaces that declare a constructor with PHP 8
Mar 28, 2020
The root cause for this is that Details can be found here. |
sebastianbergmann
added a commit
that referenced
this issue
Mar 28, 2020
This was referenced Mar 31, 2020
This was referenced Apr 23, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
Expected behavior
For example, older PHPUnit on PHP 7.2:
An example of such interface in the wild
I know PHP 8 is still in the early stages of development, however PHPUnit claims to support it, so I'd rather make this issue known.
The text was updated successfully, but these errors were encountered: