Skip to content

Commit

Permalink
Added tests for indexes and constraints (#158)
Browse files Browse the repository at this point in the history
* Added tests for indexes and constraints

* styleci fix
  • Loading branch information
darkdef committed Dec 18, 2022
1 parent 90e7822 commit 2ae89ee
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions tests/SchemaTest.php
Expand Up @@ -271,4 +271,44 @@ public function testTableSchemaConstraintsWithPdoUppercase(string $tableName, st
{
parent::testTableSchemaConstraintsWithPdoUppercase($tableName, $type, $expected);
}

public function testWorkWithUniqueConstraint(): void
{
$this->expectException(NotSupportedException::class);
$this->expectExceptionMessage(
'Yiisoft\Db\Sqlite\DDLQueryBuilder::addUnique is not supported by SQLite.'
);

parent::testWorkWithUniqueConstraint();
}

public function testWorkWithCheckConstraint(): void
{
$this->expectException(NotSupportedException::class);
$this->expectExceptionMessage(
'Yiisoft\Db\Sqlite\DDLQueryBuilder::addCheck is not supported by SQLite.'
);

parent::testWorkWithCheckConstraint();
}

public function testWorkWithDefaultValueConstraint(): void
{
$this->expectException(NotSupportedException::class);
$this->expectExceptionMessage(
'Yiisoft\Db\Sqlite\DDLQueryBuilder::addDefaultValue is not supported by SQLite.'
);

parent::testWorkWithDefaultValueConstraint();
}

public function testWorkWithPrimaryKeyConstraint(): void
{
$this->expectException(NotSupportedException::class);
$this->expectExceptionMessage(
'Yiisoft\Db\Sqlite\DDLQueryBuilder::addPrimaryKey is not supported by SQLite.'
);

parent::testWorkWithPrimaryKeyConstraint();
}
}

0 comments on commit 2ae89ee

Please sign in to comment.