Calling method()
on a test stub created using createStubForIntersectionOfInterfaces()
throws an unexpected exception #5818
Closed
Description
Q | A |
---|---|
PHPUnit version | 10.5.18 |
PHP version | 8.1.27 |
Installation Method | Composer |
Summary
Calling the method()
method on a Stub
created through the TestCase::createStubForIntersectionOfInterfaces()
method throws an unexpected exception.
Current behavior
When calling the m̀ethod()
method on a Stub
created through the TestCase::createStubForIntersectionOfInterfaces()
method, an exception is thrown: Error: Call to undefined method TestStub_Intersection_AInterface_f00d4e13_af77f05e::expects()
.
How to reproduce
public function testExample(): void
{
$stub = self::createStubForIntersectionOfInterfaces([FirstInterface::class, SecondaryInterface::class]);
$stub->method('method');
}
Expected behavior
Calling method()
on a Stub
should not throw an exception.