Closed
Description
Symfony version(s) affected: 6.0.x-dev fb21447
Description
When Symfony\Bridge\PhpUnit\ExpectDeprecationTrait
is used in your PhpUnit test (because one of the test scenario methods in current class are doing deprecations), despite calling $this->expectNotToPerformAssertions();
, output of phpunit is changed to warning, compared to no-warning/green output when not using the trait.
How to reproduce
Output for this
use PHPUnit\Framework\TestCase;
class CacheCompatibilityPassTest extends TestCase
{
public function test(): void
{
$this->expectNotToPerformAssertions();
}
}
is
OK (1 test, 0 assertions)
Process finished with exit code 0
but output for this
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
class CacheCompatibilityPassTest extends TestCase
{
use ExpectDeprecationTrait;
public function test(): void
{
$this->expectNotToPerformAssertions();
}
}
is
This test did not perform any assertions
Time: 00:00.031, Memory: 8.00 MB
OK, but incomplete, skipped, or risky tests!
Tests: 1, Assertions: 0, Risky: 1.
Process finished with exit code 0
Additional context:
Starts happening in doctrine-bundle since doctrine/DoctrineBundle#1352