File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -563,6 +563,7 @@ class to simplify writing unit tests for your custom constraints::
563563
564564 use App\Validator\ContainsAlphanumeric;
565565 use App\Validator\ContainsAlphanumericValidator;
566+ use PHPUnit\Framework\Attributes\DataProvider;
566567 use Symfony\Component\Validator\ConstraintValidatorInterface;
567568 use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
568569
@@ -580,9 +581,7 @@ class to simplify writing unit tests for your custom constraints::
580581 $this->assertNoViolation();
581582 }
582583
583- /**
584- * @dataProvider provideInvalidConstraints
585- */
584+ #[DataProvider('provideInvalidConstraints')]
586585 public function testTrueIsInvalid(ContainsAlphanumeric $constraint): void
587586 {
588587 $this->validator->validate('...', $constraint);
@@ -592,7 +591,7 @@ class to simplify writing unit tests for your custom constraints::
592591 ->assertRaised();
593592 }
594593
595- public function provideInvalidConstraints(): \Generator
594+ public static function provideInvalidConstraints(): \Generator
596595 {
597596 yield [new ContainsAlphanumeric(message: 'myMessage')];
598597 // ...
You can’t perform that action at this time.
0 commit comments