diff --git a/tests/AbstractTableSchemaTest.php b/tests/AbstractTableSchemaTest.php index dd1607072..5636ea8b8 100644 --- a/tests/AbstractTableSchemaTest.php +++ b/tests/AbstractTableSchemaTest.php @@ -24,6 +24,28 @@ public function testCompositeFk(): void $tableSchema->compositeFk(1, 'from', 'to'); } + public function testGetCatalogName(): void + { + $tableSchema = new TableSchema(); + + $this->assertNull($tableSchema->getCatalogName()); + + $tableSchema->catalogName('test'); + + $this->assertSame('test', $tableSchema->getCatalogName()); + } + + public function testGetComment(): void + { + $tableSchema = new TableSchema(); + + $this->assertNull($tableSchema->getComment()); + + $tableSchema->comment('test'); + + $this->assertSame('test', $tableSchema->getComment()); + } + public function testGetColumn(): void { // Defined column schema. @@ -92,6 +114,28 @@ public function testGetCreateSql(): void ); } + public function testGetForeignKeys(): void + { + $tableSchema = new TableSchema(); + + $this->assertSame([], $tableSchema->getForeignKeys()); + + $tableSchema->foreignKeys(['id']); + + $this->assertSame(['id'], $tableSchema->getForeignKeys()); + } + + public function testGetForeignKeysAndForeingKey(): void + { + $tableSchema = new TableSchema(); + + $this->assertSame([], $tableSchema->getForeignKeys()); + + $tableSchema->foreignKey('id', ['test', 'id']); + + $this->assertSame(['id' => ['test', 'id']], $tableSchema->getForeignKeys()); + } + public function testGetFullName(): void { $tableSchema = new TableSchema();