[Phpunit] Fix running skipped tests expecting only deprecations

This commit is contained in:
Robin Chalas 2020-01-28 01:09:27 +01:00 committed by Nicolas Grekas
parent b90664ba18
commit 6b02362c5b
2 changed files with 38 additions and 0 deletions

View File

@ -222,6 +222,10 @@ class SymfonyTestsListenerTrait
}
}
if (!$test->getTestResultObject()) {
return;
}
$annotations = $Test::parseTestMethodAnnotations(\get_class($test), $test->getName(false));
if (isset($annotations['class']['expectedDeprecation'])) {

View File

@ -0,0 +1,34 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bridge\PhpUnit\Tests;
use PHPUnit\Framework\TestCase;
/**
* This test is meant to be skipped.
*
* @requires extension ext-dummy
*/
final class OnlyExpectingDeprecationSkippedTest extends TestCase
{
/**
* Do not remove this test in the next major versions.
*
* @group legacy
*
* @expectedDeprecation unreachable
*/
public function testExpectingOnlyDeprecations()
{
$this->fail('should never be ran.');
}
}