Skip to content

Calling method() on a test stub created using createStubForIntersectionOfInterfaces() throws an unexpected exception #5818

Closed
@hugok96

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.

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions