Skip to content

PHPUnit Bridge unexpected deprecations #59882

@garak

Description

@garak

Symfony version(s) affected

6.4

Description

PHP 8.4, Symfony 6.4.19, Bridge 7.2.0
I use $this->getStub(MyEntity::class) in some tests.
I get the following deprecations when I run my test suite

Remaining indirect deprecation notices (4)

  1x: The "PHPUnit\Framework\MockObject\StubInternal" interface is considered internal This interface is not covered by the backward compatibility promise for PHPUnit. It may change without further notice. You should not use it from "TestStub_MyEntity_3a176755".
    1x in DeprecationErrorHandler::shutdown from Symfony\Bridge\PhpUnit

  1x: The "PHPUnit\Framework\MockObject\StubApi" trait is considered internal This trait is not covered by the backward compatibility promise for PHPUnit. It may change without further notice. You should not use it from "TestStub_MyEntity_3a176755".
    1x in DeprecationErrorHandler::shutdown from Symfony\Bridge\PhpUnit

  1x: The "PHPUnit\Framework\MockObject\Method" trait is considered internal This trait is not covered by the backward compatibility promise for PHPUnit. It may change without further notice. You should not use it from "TestStub_MyEntity_3a176755".
    1x in DeprecationErrorHandler::shutdown from Symfony\Bridge\PhpUnit

  1x: The "PHPUnit\Framework\MockObject\DoubledCloneMethod" trait is considered internal This trait is not covered by the backward compatibility promise for PHPUnit. It may change without further notice. You should not use it from "TestStub_MyEntity_3a176755".
    1x in DeprecationErrorHandler::shutdown from Symfony\Bridge\PhpUnit

How to reproduce

Run a test with some entity stubbing

Possible Solution

From a comment I received on Slack (so, not my idea, but I trust the source): "I think the DebugClassLoader misses support for one of the PHPUnit interface used to identify generated mock classes"

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions