@@ -1220,22 +1220,30 @@ public static function getEnumDeclarationSQLProvider(): array
12201220
12211221 /** @param array<string> $values */
12221222 #[DataProvider('getEnumDeclarationWithLengthSQLProvider ' )]
1223- public function testGetEnumDeclarationWithLengthSQL (array $ values , int $ length , string $ expectedSQL ): void
1223+ public function testGetEnumDeclarationWithLengthSQL (array $ values , int $ length , ? string $ expectedSQL = null ): void
12241224 {
1225- self ::assertSame ($ expectedSQL , $ this ->platform ->getEnumDeclarationSQL ([
1225+ if ($ expectedSQL === null ) {
1226+ $ this ->expectException (InvalidArgumentException::class);
1227+ }
1228+
1229+ $ result = $ this ->platform ->getEnumDeclarationSQL ([
12261230 'values ' => $ values ,
12271231 'length ' => $ length ,
1228- ]));
1232+ ]);
1233+
1234+ if ($ expectedSQL !== null ) {
1235+ self ::assertSame ($ expectedSQL , $ result );
1236+ }
12291237 }
12301238
1231- /** @return array<string, array{array<string>, int, string}> */
1239+ /** @return array<string, array{array<string>, int, string|null }> */
12321240 public static function getEnumDeclarationWithLengthSQLProvider (): array
12331241 {
12341242 return [
12351243 'single value and bigger length ' => [['foo ' ], 42 , 'VARCHAR(42) ' ],
1236- 'single value and lower length ' => [['foo ' ], 1 , ' VARCHAR(3) ' ],
1244+ 'single value and lower length ' => [['foo ' ], 1 , null ],
12371245 'multiple values and bigger length ' => [['foo ' , 'bar1 ' ], 42 , 'VARCHAR(42) ' ],
1238- 'multiple values and lower length ' => [['foo ' , 'bar1 ' ], 2 , ' VARCHAR(4) ' ],
1246+ 'multiple values and lower length ' => [['foo ' , 'bar1 ' ], 2 , null ],
12391247 ];
12401248 }
12411249
0 commit comments