Skip to content

Commit e034b15

Browse files
committed
minor #62164 Clean up legacy groups in tests (xabbuh)
This PR was merged into the 7.4 branch. Discussion ---------- Clean up legacy groups in tests | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT In the past, we needed the legacy group with PHPUnit < 10 to indicate that a test was expected to trigger deprecations. With our update to PHPUnit 12 this is no longer necessary. We now use the group only to skip these tests when running high deps tests with different major versions. The tests from which the legacy group is dropped do not handle deprecated Symfony features but deal with features that users can use to trigger deprecations leveraging our components. They don't have to be skipped in cross-version test runs. Commits ------- 7f0acb4 clean up legacy groups in tests
2 parents 5108567 + 7f0acb4 commit e034b15

File tree

11 files changed

+0
-30
lines changed

11 files changed

+0
-30
lines changed

src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ public function testLintFileCompileTimeException()
7777
* When deprecations are not reported by the command, the testsuite reporter will catch them so we need to mark the test as ignoring deprecations.
7878
*/
7979
#[IgnoreDeprecations]
80-
#[Group('legacy')]
8180
public function testLintFileWithNotReportedDeprecation()
8281
{
8382
$tester = $this->createCommandTester();

src/Symfony/Bridge/Twig/Tests/Validator/Constraints/TwigValidatorTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bridge\Twig\Tests\Validator\Constraints;
1313

1414
use PHPUnit\Framework\Attributes\DataProvider;
15-
use PHPUnit\Framework\Attributes\Group;
1615
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1716
use Symfony\Bridge\Twig\Validator\Constraints\Twig;
1817
use Symfony\Bridge\Twig\Validator\Constraints\TwigValidator;
@@ -68,7 +67,6 @@ public function testInvalidValues($value, $message, $line)
6867
* When deprecations are skipped by the validator, the testsuite reporter will catch them so we need to mark the test as ignoring deprecations.
6968
*/
7069
#[IgnoreDeprecations]
71-
#[Group('legacy')]
7270
public function testTwigWithSkipDeprecation()
7371
{
7472
$constraint = new Twig(skipDeprecations: true);

src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTestCase.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor;
1313

1414
use PHPUnit\Framework\Attributes\DataProvider;
15-
use PHPUnit\Framework\Attributes\Group;
1615
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1716
use PHPUnit\Framework\TestCase;
1817
use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\FooUnitEnum;
@@ -189,7 +188,6 @@ public static function getDescribeContainerDefinitionWhichIsAnAliasTestData(): a
189188
* The #[IgnoreDeprecation] attribute must be kept as deprecations will always be raised.
190189
*/
191190
#[IgnoreDeprecations]
192-
#[Group('legacy')]
193191
#[DataProvider('getDescribeContainerParameterTestData')]
194192
public function testDescribeContainerParameter($parameter, $expectedDescription, array $options, $file)
195193
{
@@ -236,7 +234,6 @@ public static function getDescribeCallableTestData(): array
236234
}
237235

238236
#[IgnoreDeprecations]
239-
#[Group('legacy')]
240237
#[DataProvider('getDescribeDeprecatedCallableTestData')]
241238
public function testDescribeDeprecatedCallable($callable, $expectedDescription, $file)
242239
{

src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,6 @@ public function testResolveParameter()
404404
}
405405

406406
#[IgnoreDeprecations]
407-
#[Group('legacy')]
408407
public function testOptionalParameter()
409408
{
410409
$container = new ContainerBuilder();

src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveReferencesToAliasesPassTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\DependencyInjection\Tests\Compiler;
1313

14-
use PHPUnit\Framework\Attributes\Group;
1514
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1615
use PHPUnit\Framework\TestCase;
1716
use Symfony\Component\DependencyInjection\Alias;
@@ -88,7 +87,6 @@ public function testResolveFactory()
8887
* The test must be marked as ignoring deprecations as it always expects a deprecation.
8988
*/
9089
#[IgnoreDeprecations]
91-
#[Group('legacy')]
9290
public function testDeprecationNoticeWhenReferencedByAlias()
9391
{
9492
$this->expectUserDeprecationMessage('Since foobar 1.2.3.4: The "deprecated_foo_alias" service alias is deprecated. You should stop using it, as it will be removed in the future. It is being referenced by the "alias" alias.');
@@ -110,7 +108,6 @@ public function testDeprecationNoticeWhenReferencedByAlias()
110108
* The test must be marked as ignoring deprecations as it always expects a deprecation.
111109
*/
112110
#[IgnoreDeprecations]
113-
#[Group('legacy')]
114111
public function testDeprecationNoticeWhenReferencedByDefinition()
115112
{
116113
$this->expectUserDeprecationMessage('Since foobar 1.2.3.4: The "foo_aliased" service alias is deprecated. You should stop using it, as it will be removed in the future. It is being referenced by the "definition" service.');

src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ public function testDefinitions()
115115
* The test must be marked as ignoring deprecations as it always expects a deprecation.
116116
*/
117117
#[IgnoreDeprecations]
118-
#[Group('legacy')]
119118
public function testDeprecateParameter()
120119
{
121120
$builder = new ContainerBuilder();
@@ -132,7 +131,6 @@ public function testDeprecateParameter()
132131
* The test must be marked as ignoring deprecations as it always expects a deprecation.
133132
*/
134133
#[IgnoreDeprecations]
135-
#[Group('legacy')]
136134
public function testParameterDeprecationIsTrgiggeredWhenCompiled()
137135
{
138136
$builder = new ContainerBuilder();
@@ -2015,7 +2013,6 @@ public function testAutoAliasing()
20152013
* The test must be marked as ignoring deprecations as it always expects a deprecation.
20162014
*/
20172015
#[IgnoreDeprecations]
2018-
#[Group('legacy')]
20192016
public function testDirectlyAccessingDeprecatedPublicService()
20202017
{
20212018
$this->expectUserDeprecationMessage('Since foo/bar 3.8: Accessing the "Symfony\Component\DependencyInjection\Tests\A" service directly from the container is deprecated, use dependency injection instead.');

src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Bar\FooLazyClass;
1515
use PHPUnit\Framework\Attributes\DataProvider;
16-
use PHPUnit\Framework\Attributes\Group;
1716
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1817
use PHPUnit\Framework\Attributes\TestWith;
1918
use PHPUnit\Framework\TestCase;
@@ -483,7 +482,6 @@ public function testDumpAutowireData()
483482
* The test must be marked as ignoring deprecations as it always expects a deprecation.
484483
*/
485484
#[IgnoreDeprecations]
486-
#[Group('legacy')]
487485
public function testDeprecatedParameters()
488486
{
489487
$container = include self::$fixturesPath.'/containers/container_deprecated_parameters.php';
@@ -500,7 +498,6 @@ public function testDeprecatedParameters()
500498
* The test must be marked as ignoring deprecations as it always expects a deprecation.
501499
*/
502500
#[IgnoreDeprecations]
503-
#[Group('legacy')]
504501
public function testDeprecatedParametersAsFiles()
505502
{
506503
$container = include self::$fixturesPath.'/containers/container_deprecated_parameters.php';
@@ -1800,7 +1797,6 @@ public function testDumpServiceWithAbstractArgument()
18001797
* The test must be marked as ignoring deprecations as it always expects a deprecation.
18011798
*/
18021799
#[IgnoreDeprecations]
1803-
#[Group('legacy')]
18041800
public function testDirectlyAccessingDeprecatedPublicService()
18051801
{
18061802
$this->expectUserDeprecationMessage('Since foo/bar 3.8: Accessing the "bar" service directly from the container is deprecated, use dependency injection instead.');

src/Symfony/Component/DependencyInjection/Tests/ParameterBag/FrozenParameterBagTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\DependencyInjection\Tests\ParameterBag;
1313

14-
use PHPUnit\Framework\Attributes\Group;
1514
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1615
use PHPUnit\Framework\TestCase;
1716
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
@@ -67,7 +66,6 @@ public function testDeprecate()
6766
* The test must be marked as ignoring deprecations as it always expects a deprecation.
6867
*/
6968
#[IgnoreDeprecations]
70-
#[Group('legacy')]
7169
public function testGetDeprecated()
7270
{
7371
$bag = new FrozenParameterBag(

src/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\DependencyInjection\Tests\ParameterBag;
1313

1414
use PHPUnit\Framework\Attributes\DataProvider;
15-
use PHPUnit\Framework\Attributes\Group;
1615
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1716
use PHPUnit\Framework\Attributes\TestWith;
1817
use PHPUnit\Framework\TestCase;
@@ -138,7 +137,6 @@ public static function provideGetThrowParameterNotFoundExceptionData()
138137
* The test must be marked as ignoring deprecations as it always expects a deprecation.
139138
*/
140139
#[IgnoreDeprecations]
141-
#[Group('legacy')]
142140
public function testDeprecate()
143141
{
144142
$bag = new ParameterBag(['foo' => 'bar']);
@@ -154,7 +152,6 @@ public function testDeprecate()
154152
* The test must be marked as ignoring deprecations as it always expects a deprecation.
155153
*/
156154
#[IgnoreDeprecations]
157-
#[Group('legacy')]
158155
public function testDeprecateWithMessage()
159156
{
160157
$bag = new ParameterBag(['foo' => 'bar']);
@@ -170,7 +167,6 @@ public function testDeprecateWithMessage()
170167
* The test must be marked as ignoring deprecations as it always expects a deprecation.
171168
*/
172169
#[IgnoreDeprecations]
173-
#[Group('legacy')]
174170
public function testDeprecationIsTriggeredWhenResolved()
175171
{
176172
$bag = new ParameterBag(['foo' => '%bar%', 'bar' => 'baz']);

src/Symfony/Component/Routing/Tests/Generator/Dumper/CompiledUrlGeneratorDumperTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\Routing\Tests\Generator\Dumper;
1313

14-
use PHPUnit\Framework\Attributes\Group;
1514
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1615
use PHPUnit\Framework\TestCase;
1716
use Symfony\Component\Routing\Exception\RouteCircularReferenceException;
@@ -338,7 +337,6 @@ public function testIndirectCircularReferenceShouldThrowAnException()
338337
}
339338

340339
#[IgnoreDeprecations]
341-
#[Group('legacy')]
342340
public function testDeprecatedAlias()
343341
{
344342
$this->expectUserDeprecationMessage('Since foo/bar 1.0.0: The "b" route alias is deprecated. You should stop using it, as it will be removed in the future.');
@@ -355,7 +353,6 @@ public function testDeprecatedAlias()
355353
}
356354

357355
#[IgnoreDeprecations]
358-
#[Group('legacy')]
359356
public function testDeprecatedAliasWithCustomMessage()
360357
{
361358
$this->expectUserDeprecationMessage('Since foo/bar 1.0.0: foo b.');
@@ -372,7 +369,6 @@ public function testDeprecatedAliasWithCustomMessage()
372369
}
373370

374371
#[IgnoreDeprecations]
375-
#[Group('legacy')]
376372
public function testTargettingADeprecatedAliasShouldTriggerDeprecation()
377373
{
378374
$this->expectUserDeprecationMessage('Since foo/bar 1.0.0: foo b.');

0 commit comments

Comments
 (0)