Skip to content

Commit

Permalink
Raise code-coverage 100% TableSchema::class. (#422)
Browse files Browse the repository at this point in the history
Raise code-coverage 100% TableSchema::class. (#422)
  • Loading branch information
terabytesoftw committed Dec 20, 2022
1 parent 4e80a8b commit add6a27
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions tests/AbstractTableSchemaTest.php
Expand Up @@ -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.
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit add6a27

Please sign in to comment.