Closed
Description
Symfony version(s) affected: 4.1.5
Description
Adding <env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled" />
to phpunit.xml.dist
has no affect.
How to reproduce
Install the symfony skeleteon
composer create-project symfony/skeleton:4.1.* bug_app
cd bug_app
composer require --dev "symfony/phpunit-bridge:*"
php bin/phpunit
Add <env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled" />
to phpunit.xml.dist as per the configuration docs.
Create a new DeprecatedTest: https://github.com/leevigraham/symonfy-phpunit-bridge/blob/master/tests/DeprecatedTest.php
<?php
namespace App\Tests;
use PHPUnit\Framework\TestCase;
class DeprecatedTest extends TestCase
{
public function testDeprecatedCode()
{
@trigger_error('This "Foo" method is deprecated.', E_USER_DEPRECATED);
@trigger_error('The second argument of the "Bar" method is deprecated.', E_USER_DEPRECATED);
}
}
Run php bin/phpunit
again. Deprecation notices are shown.
Example Repo: https://github.com/leevigraham/symonfy-phpunit-bridge
Additional context
Screenshot of issue:
Running SYMFONY_DEPRECATIONS_HELPER=disabled php bin/phpunit
produces expected output: