1414namespace Ecommit \ScalarValues \Tests ;
1515
1616use Ecommit \ScalarValues \ScalarValues ;
17+ use PHPUnit \Framework \Attributes \DataProvider ;
1718use PHPUnit \Framework \TestCase ;
1819
1920class ScalarValuesTest extends TestCase
2021{
21- /**
22- * @dataProvider getTestContainsOnlyScalarValuesProdiver
23- */
22+ #[DataProvider('getTestContainsOnlyScalarValuesProdiver ' )]
2423 public function testContainsOnlyScalarValues (array $ input , bool $ expected ): void
2524 {
2625 $ this ->assertEquals (
@@ -29,7 +28,7 @@ public function testContainsOnlyScalarValues(array $input, bool $expected): void
2928 );
3029 }
3130
32- public function getTestContainsOnlyScalarValuesProdiver (): array
31+ public static function getTestContainsOnlyScalarValuesProdiver (): array
3332 {
3433 // Colonne 1: Input
3534 // Colonne 2: Expected result
@@ -48,16 +47,14 @@ public function getTestContainsOnlyScalarValuesProdiver(): array
4847 ];
4948 }
5049
51- /**
52- * @dataProvider getNotArrayInputProdiver
53- */
50+ #[DataProvider('getNotArrayInputProdiver ' )]
5451 public function testContainsOnlyScalarValuesInputError (mixed $ input ): void
5552 {
5653 $ this ->expectException (\TypeError::class);
5754 ScalarValues::containsOnlyScalarValues ($ input ); // @phpstan-ignore-line
5855 }
5956
60- public function getNotArrayInputProdiver (): array
57+ public static function getNotArrayInputProdiver (): array
6158 {
6259 return [
6360 [null ],
@@ -68,9 +65,7 @@ public function getNotArrayInputProdiver(): array
6865 ];
6966 }
7067
71- /**
72- * @dataProvider getTestFilterScalarValuesProdiver
73- */
68+ #[DataProvider('getTestFilterScalarValuesProdiver ' )]
7469 public function testFilterScalarValues (array $ input , array $ expected ): void
7570 {
7671 $ this ->assertEquals (
@@ -79,7 +74,7 @@ public function testFilterScalarValues(array $input, array $expected): void
7974 );
8075 }
8176
82- public function getTestFilterScalarValuesProdiver (): array
77+ public static function getTestFilterScalarValuesProdiver (): array
8378 {
8479 // Colonne 1: Input
8580 // Colonne 2: Expected result
@@ -98,9 +93,7 @@ public function getTestFilterScalarValuesProdiver(): array
9893 ];
9994 }
10095
101- /**
102- * @dataProvider getNotArrayInputProdiver
103- */
96+ #[DataProvider('getNotArrayInputProdiver ' )]
10497 public function testFilterScalarValuesInputError (mixed $ input ): void
10598 {
10699 $ this ->expectException (\TypeError::class);
0 commit comments