Skip to content

Conversation

@fancyweb
Copy link
Contributor

@fancyweb fancyweb commented Oct 2, 2020

Q A
Branch? 5.1
Bug fix? yes
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

#38031 caused an unwanted regression: if the frame class matches SymfonyTestsListenerFor it used to always return, now it continues so the originClass and originMethod properties are set. Therefore, the deprecation is considered as coming from the test listener. It ends up in the "legacy" group and muted because the test listeners contains the word "Legacy" in their namespaces.

Example test:

<?php

namespace App\Tests;

use PHPUnit\Framework\TestCase;
use Symfony\Component\EventDispatcher\DependencyInjection\ExtractingEventDispatcher;

final class FooTest extends TestCase
{
    public function test(): void
    {
        // ExtractingEventDispatcher is @internal
        new class extends ExtractingEventDispatcher {};

        $this->assertTrue(true);
    }
}

On 4.4:

Other deprecation notices (1)

  1x: The "Symfony\Component\EventDispatcher\DependencyInjection\ExtractingEventDispatcher" class is considered internal. It may change without further notice. You should not use it from "Symfony\Component\EventDispatcher\DependencyInjection\ExtractingEventDispatcher@anonymous".

On 5.1:

Legacy deprecation notices (1)

@fancyweb fancyweb force-pushed the php-unit-bridge-fix-deprecation-file branch from 59226a5 to 1ba06a0 Compare October 2, 2020 12:58
@nicolas-grekas
Copy link
Member

Thank you @fancyweb.

@nicolas-grekas nicolas-grekas merged commit 8ae323b into symfony:5.1 Oct 2, 2020
@fancyweb fancyweb deleted the php-unit-bridge-fix-deprecation-file branch October 2, 2020 12:59
@fabpot fabpot mentioned this pull request Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants