Skip to content

Commit be9abff

Browse files
Add tests
1 parent 4d0341b commit be9abff

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/Platforms/AbstractPlatformTestCase.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,6 +1218,23 @@ public static function getEnumDeclarationSQLProvider(): array
12181218
];
12191219
}
12201220

1221+
#[DataProvider('getEnumDeclarationWithLengthSQLProvider')]
1222+
public function testGetEnumDeclarationWithLengthSQL(array $values, int $length, string $expectedSQL): void
1223+
{
1224+
self::assertSame($expectedSQL, $this->platform->getEnumDeclarationSQL(['values' => $values, 'length' => $length]));
1225+
}
1226+
1227+
/** @return array<string, array{array<string>, int, string}> */
1228+
public static function getEnumDeclarationWithLengthSQLProvider(): array
1229+
{
1230+
return [
1231+
'single value and bigger length' => [['foo'], 42, 'VARCHAR(42)'],
1232+
'single value and lower length' => [['foo'], 1, 'VARCHAR(3)'],
1233+
'multiple values and bigger length' => [['foo', 'bar1'], 42, 'VARCHAR(42)'],
1234+
'multiple values and lower length' => [['foo', 'bar1'], 2, 'VARCHAR(4)'],
1235+
];
1236+
}
1237+
12211238
/** @param array<mixed> $column */
12221239
#[DataProvider('getEnumDeclarationSQLWithInvalidValuesProvider')]
12231240
public function testGetEnumDeclarationSQLWithInvalidValues(array $column): void

0 commit comments

Comments
 (0)