diff --git a/tests/Db/QueryBuilder/ColumnDefinitionBuilderTest.php b/tests/Db/QueryBuilder/ColumnDefinitionBuilderTest.php new file mode 100644 index 000000000..e240940ca --- /dev/null +++ b/tests/Db/QueryBuilder/ColumnDefinitionBuilderTest.php @@ -0,0 +1,53 @@ +getConnection(); + $qb = $db->getQueryBuilder(); + + $cdb = new ColumnDefinitionBuilder($qb); + + $column = ColumnBuilder::integer(); + + $this->assertEquals($cdb->build($column), $cdb->buildAlter($column)); + } + + public function testBuildEmptyDefaultForUuid(): void + { + $db = $this->getConnection(); + $qb = $db->getQueryBuilder(); + + $cdb = new class ($qb) extends AbstractColumnDefinitionBuilder { + protected function getDbType(ColumnSchemaInterface $column): string + { + return 'uuid'; + } + }; + + $column = ColumnBuilder::uuidPrimaryKey(); + + $this->assertSame('uuid PRIMARY KEY', $cdb->build($column)); + } +}