Skip to content

Commit 2ae89ee

Browse files
authored
Added tests for indexes and constraints (#158)
* Added tests for indexes and constraints * styleci fix
1 parent 90e7822 commit 2ae89ee

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

tests/SchemaTest.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,4 +271,44 @@ public function testTableSchemaConstraintsWithPdoUppercase(string $tableName, st
271271
{
272272
parent::testTableSchemaConstraintsWithPdoUppercase($tableName, $type, $expected);
273273
}
274+
275+
public function testWorkWithUniqueConstraint(): void
276+
{
277+
$this->expectException(NotSupportedException::class);
278+
$this->expectExceptionMessage(
279+
'Yiisoft\Db\Sqlite\DDLQueryBuilder::addUnique is not supported by SQLite.'
280+
);
281+
282+
parent::testWorkWithUniqueConstraint();
283+
}
284+
285+
public function testWorkWithCheckConstraint(): void
286+
{
287+
$this->expectException(NotSupportedException::class);
288+
$this->expectExceptionMessage(
289+
'Yiisoft\Db\Sqlite\DDLQueryBuilder::addCheck is not supported by SQLite.'
290+
);
291+
292+
parent::testWorkWithCheckConstraint();
293+
}
294+
295+
public function testWorkWithDefaultValueConstraint(): void
296+
{
297+
$this->expectException(NotSupportedException::class);
298+
$this->expectExceptionMessage(
299+
'Yiisoft\Db\Sqlite\DDLQueryBuilder::addDefaultValue is not supported by SQLite.'
300+
);
301+
302+
parent::testWorkWithDefaultValueConstraint();
303+
}
304+
305+
public function testWorkWithPrimaryKeyConstraint(): void
306+
{
307+
$this->expectException(NotSupportedException::class);
308+
$this->expectExceptionMessage(
309+
'Yiisoft\Db\Sqlite\DDLQueryBuilder::addPrimaryKey is not supported by SQLite.'
310+
);
311+
312+
parent::testWorkWithPrimaryKeyConstraint();
313+
}
274314
}

0 commit comments

Comments
 (0)