1212use OCA \Tables \Dto \Column as ColumnDto ;
1313use OCA \Tables \Errors \BadRequestError ;
1414use OCA \Tables \Validation \ColumnDtoValidator ;
15+ use PHPUnit \Framework \Attributes \DataProvider ;
1516use Test \TestCase ;
1617
1718class ColumnDtoValidatorTest extends TestCase {
@@ -53,9 +54,7 @@ public function testTechnicalNameOver200CharsIsRejected(): void {
5354 $ this ->validator ->validate ($ this ->dto ('test ' . str_repeat ('t ' , 197 )));
5455 }
5556
56- /**
57- * @dataProvider reservedNameProvider
58- */
57+ #[DataProvider('reservedNameProvider ' )]
5958 public function testReservedTechnicalNamesAreRejected (string $ name ): void {
6059 $ this ->expectException (BadRequestError::class);
6160 $ this ->expectExceptionMessageMatches ('/reserved/i ' );
@@ -73,9 +72,7 @@ public static function reservedNameProvider(): array {
7372 ];
7473 }
7574
76- /**
77- * @dataProvider invalidFormatProvider
78- */
75+ #[DataProvider('invalidFormatProvider ' )]
7976 public function testInvalidFormatIsRejected (string $ name ): void {
8077 $ this ->expectException (BadRequestError::class);
8178 $ this ->expectExceptionMessageMatches ('/start with a letter|lowercase|underscores/i ' );
@@ -93,9 +90,7 @@ public static function invalidFormatProvider(): array {
9390 ];
9491 }
9592
96- /**
97- * @dataProvider validFormatProvider
98- */
93+ #[DataProvider('validFormatProvider ' )]
9994 public function testValidFormatIsAccepted (string $ name ): void {
10095 $ this ->expectNotToPerformAssertions ();
10196 $ this ->validator ->validate ($ this ->dto ($ name ));
0 commit comments