@@ -19,6 +19,17 @@ protected function setUp(): void
1919 $ this ->createTestTable ();
2020 }
2121
22+ /**
23+ * @param array{description: string, input: array<int, string>} $testCase
24+ */
25+ #[DataProvider('provideArrayTestCases ' )]
26+ public function test_array_round_trip (array $ testCase ): void
27+ {
28+ $ id = $ this ->insertArray ($ testCase ['input ' ]);
29+
30+ $ this ->assertArrayRoundTrip ($ id , $ testCase ['input ' ], $ testCase ['description ' ]);
31+ }
32+
2233 /**
2334 * @return array<int, array{0: array{description: string, input: array<int, string>}}>
2435 */
@@ -44,15 +55,11 @@ public static function provideArrayTestCases(): array
4455 ];
4556 }
4657
47- /**
48- * @param array{description: string, input: array<int, string>} $testCase
49- */
50- #[DataProvider('provideArrayTestCases ' )]
51- public function test_array_round_trip (array $ testCase ): void
58+ #[DataProvider('provideInvalidArrayFormats ' )]
59+ public function test_invalid_array_formats_throw_exceptions (array $ testCase ): void
5260 {
53- $ id = $ this ->insertArray ($ testCase ['input ' ]);
54-
55- $ this ->assertArrayRoundTrip ($ id , $ testCase ['input ' ], $ testCase ['description ' ]);
61+ $ this ->expectException (InvalidArrayFormatException::class);
62+ PostgresArrayToPHPArrayTransformer::transformPostgresArrayToPHPArray ($ testCase ['input ' ]); // @phpstan-ignore-line
5663 }
5764
5865 /**
@@ -68,13 +75,6 @@ public static function provideInvalidArrayFormats(): array
6875 ];
6976 }
7077
71- #[DataProvider('provideInvalidArrayFormats ' )]
72- public function test_invalid_array_formats_throw_exceptions (array $ testCase ): void
73- {
74- $ this ->expectException (InvalidArrayFormatException::class);
75- PostgresArrayToPHPArrayTransformer::transformPostgresArrayToPHPArray ($ testCase ['input ' ]); // @phpstan-ignore-line
76- }
77-
7878 private function createTestTable (): void
7979 {
8080 $ this ->dropTestTableIfItExists (self ::TABLE_NAME );
0 commit comments