Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DebugClassLoader is reporting deprecation about final classes coming out of the test code. #40651

Closed
@VincentLanglet

Description

@VincentLanglet

Symfony version(s) affected: 5.2.6 (and related 4.4 release)

Description
@nicolas-grekas fixed a lot of our deprecation with #40508
But we still having one:
sonata-project/SonataDoctrineORMAdminBundle#1382

The message

Remaining self deprecation notices (1)

  1x: The "Sonata\DoctrineORMAdminBundle\Filter\NullFilter" class is considered final. It may change without further notice as of its next major version. You should not extend it from "Sonata\DoctrineORMAdminBundle\Filter\EmptyFilter".
    1x in FieldDescriptionTest::testOptions from Sonata\DoctrineORMAdminBundle\Tests\Admin

Is thrown in the first executed test.

We're thinking it's because of our bootstrap files running
https://github.com/sonata-project/SonataDoctrineORMAdminBundle/blob/be010e282956d29a6392f2051f7b06f7feb590d2/tests/custom_bootstrap.php#L19
and https://github.com/sonata-project/SonataDoctrineORMAdminBundle/blob/be010e282956d29a6392f2051f7b06f7feb590d2/tests/App/AppKernel.php#L53
And loading every class is triggering the issue for the EmptyFilter
which extends a @final class.

It feel wrong having to add a @group legacy annotation to the first test just to avoid this deprecation.
Shouldn't the DebugClassLoader just reporting @final class used INSIDE the test ?

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