2525use DarkWebDesign \SymfonyAddonConstraints \Bsn ;
2626use DarkWebDesign \SymfonyAddonConstraints \BsnValidator ;
2727use DarkWebDesign \SymfonyAddonConstraints \Tests \Models \ToStringObject ;
28+ use PHPUnit \Framework \Attributes \CoversClass ;
29+ use PHPUnit \Framework \Attributes \DataProvider ;
2830use Symfony \Component \Validator \Constraints as Assert ;
2931use Symfony \Component \Validator \Exception \UnexpectedTypeException ;
3032use Symfony \Component \Validator \Test \ConstraintValidatorTestCase ;
3133
3234/**
3335 * @template-extends ConstraintValidatorTestCase<BsnValidator>
3436 *
35- * @covers \DarkWebDesign\SymfonyAddonConstraints\BsnValidator
36- *
3737 * @internal
3838 */
39+ #[CoversClass(BsnValidator::class)]
3940class BsnValidatorTest extends ConstraintValidatorTestCase
4041{
4142 protected function createValidator (): BsnValidator
4243 {
4344 return new BsnValidator ();
4445 }
4546
46- /**
47- * @dataProvider providerValidBsn
48- */
47+ #[DataProvider('providerValidBsn ' )]
4948 public function testValidate (string |\Stringable $ value ): void
5049 {
5150 $ this ->validator ->validate ($ value , new Bsn ());
@@ -76,9 +75,7 @@ public function testValidateEmptyString(): void
7675 $ this ->assertNoViolation ();
7776 }
7877
79- /**
80- * @dataProvider providerNoScalar
81- */
78+ #[DataProvider('providerNoScalar ' )]
8279 public function testValidateNoScalar (mixed $ value ): void
8380 {
8481 $ this ->expectException (UnexpectedTypeException::class);
@@ -88,9 +85,7 @@ public function testValidateNoScalar(mixed $value): void
8885 $ this ->assertNoViolation ();
8986 }
9087
91- /**
92- * @dataProvider providerInvalidBsn
93- */
88+ #[DataProvider('providerInvalidBsn ' )]
9489 public function testValidateViolation (string |\Stringable $ value ): void
9590 {
9691 $ constraint = new Bsn ();
@@ -105,7 +100,7 @@ public function testValidateViolation(string|\Stringable $value): void
105100 /**
106101 * @return array<string, array{string|\Stringable}>
107102 */
108- public function providerValidBsn (): array
103+ public static function providerValidBsn (): array
109104 {
110105 return [
111106 'valid1 ' => ['111222333 ' ],
@@ -117,7 +112,7 @@ public function providerValidBsn(): array
117112 /**
118113 * @return array<string, array{mixed}>
119114 */
120- public function providerNoScalar (): array
115+ public static function providerNoScalar (): array
121116 {
122117 return [
123118 'array ' => [['foo ' , 'bar ' ]],
@@ -130,7 +125,7 @@ public function providerNoScalar(): array
130125 /**
131126 * @return array<string, array{string|\Stringable}>
132127 */
133- public function providerInvalidBsn (): array
128+ public static function providerInvalidBsn (): array
134129 {
135130 return [
136131 'zeros ' => ['000000000 ' ],
0 commit comments