Skip to content

Commit f0b2499

Browse files
committed
clean up legacy groups in tests
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.
1 parent bb8a2c3 commit f0b2499

File tree

6 files changed

+0
-17
lines changed

6 files changed

+0
-17
lines changed

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();

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.');

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.');

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.');

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(

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']);

0 commit comments

Comments
 (0)