Skip to content

Commit 4fadd6c

Browse files
committed
replace PHPUnit annotations with attributes
1 parent 1ee26c4 commit 4fadd6c

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

Tests/OptionsResolverTest.php

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

1414
use PHPUnit\Framework\Assert;
15+
use PHPUnit\Framework\Attributes\DataProvider;
1516
use PHPUnit\Framework\Attributes\Group;
1617
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1718
use PHPUnit\Framework\TestCase;
@@ -35,9 +36,7 @@ protected function setUp(): void
3536
$this->resolver = new OptionsResolver();
3637
}
3738

38-
/**
39-
* @dataProvider provideResolveWithIgnoreUndefined
40-
*/
39+
#[DataProvider('provideResolveWithIgnoreUndefined')]
4140
public function testResolveWithIgnoreUndefined(array $defaults, array $options, array $expected)
4241
{
4342
$this->resolver
@@ -543,9 +542,7 @@ public function testIsNotDeprecatedIfEmptyString()
543542
$this->assertFalse($this->resolver->isDeprecated('foo'));
544543
}
545544

546-
/**
547-
* @dataProvider provideDeprecationData
548-
*/
545+
#[DataProvider('provideDeprecationData')]
549546
public function testDeprecationMessages(\Closure $configureOptions, array $options, ?array $expectedError, int $expectedCount)
550547
{
551548
$count = 0;
@@ -909,9 +906,7 @@ public function testResolveFailsWithCorrectLevelsButWrongScalar()
909906
]);
910907
}
911908

912-
/**
913-
* @dataProvider provideInvalidTypes
914-
*/
909+
#[DataProvider('provideInvalidTypes')]
915910
public function testResolveFailsIfInvalidType($actualType, $allowedType, $exceptionMessage)
916911
{
917912
$this->resolver->setDefined('option');
@@ -2039,19 +2034,15 @@ public function testNestedArraysException()
20392034
]);
20402035
}
20412036

2042-
/**
2043-
* @dataProvider provideValidDeeplyNestedUnionTypes
2044-
*/
2037+
#[DataProvider('provideValidDeeplyNestedUnionTypes')]
20452038
public function testDeeplyNestedUnionTypes(string $type, $validValue)
20462039
{
20472040
$this->resolver->setDefined('option');
20482041
$this->resolver->setAllowedTypes('option', $type);
20492042
$this->assertEquals(['option' => $validValue], $this->resolver->resolve(['option' => $validValue]));
20502043
}
20512044

2052-
/**
2053-
* @dataProvider provideInvalidDeeplyNestedUnionTypes
2054-
*/
2045+
#[DataProvider('provideInvalidDeeplyNestedUnionTypes')]
20552046
public function testDeeplyNestedUnionTypesException(string $type, $invalidValue, string $expectedExceptionMessage)
20562047
{
20572048
$this->resolver->setDefined('option');

0 commit comments

Comments
 (0)