You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On a related note, although I cannot create a simple repro for the following error, here's a link to the broken unit test and output for a possibly-related issue with supporting static return types. When dumping the eval'd code here, I noticed that some of my tests are resulting in code like the following being generated:
class static
{
}
classMock_static_5832468dextendsstaticimplementsPHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;
use \PHPUnit\Framework\MockObject\MockedCloneMethod;
}
It looks like static is being treated like the actual name of a return type rather than a special type.
The text was updated successfully, but these errors were encountered:
sebastianbergmann
changed the title
Mocked methods with static return types are not supported
Methods with "static" return type (introduced in PHP 8) are not handled correctly by test double code generator
Oct 6, 2020
Summary
The
static
return type isn't fully supported in mocks in PHP 8.0.Current behavior
I get the following error when running a test:
How to reproduce
Expected behavior
The above test should pass.
Additional notes
On a related note, although I cannot create a simple repro for the following error, here's a link to the broken unit test and output for a possibly-related issue with supporting
static
return types. When dumping the eval'd code here, I noticed that some of my tests are resulting in code like the following being generated:It looks like
static
is being treated like the actual name of a return type rather than a special type.The text was updated successfully, but these errors were encountered: