From 5ea23a1630fecd4567406f7baacc26f3af12b532 Mon Sep 17 00:00:00 2001 From: Valerii Gorbachev Date: Sun, 18 Dec 2022 20:59:08 +0300 Subject: [PATCH] Added tests for indexes and constraints (#127) --- tests/SchemaTest.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/SchemaTest.php b/tests/SchemaTest.php index f03ea0c..f763ee5 100644 --- a/tests/SchemaTest.php +++ b/tests/SchemaTest.php @@ -222,4 +222,29 @@ function ($params) use ($expectedTableName, $expectedSchemaName) { $schema = new Schema($mockDb, DbHelper::getSchemaCache(), 'dbo'); $schema->getTablePrimaryKey($tableName); } + + public function testWorkWithDefaultValueConstraint(): void + { + $this->expectException(NotSupportedException::class); + $this->expectExceptionMessage( + 'Yiisoft\Db\Oracle\DDLQueryBuilder::addDefaultValue is not supported by Oracle.' + ); + + parent::testWorkWithDefaultValueConstraint(); + } + + public function withIndexDataProvider(): array + { + /* + * Bitmap indexes are not available for standard edition. + return array_merge(parent::withIndexDataProvider(), [ + [ + 'indexType' => QueryBuilder::INDEX_BITMAP, + 'indexMethod' => null, + 'columnType' => 'varchar(16)', + ], + ]); + */ + return parent::withIndexDataProvider(); + } }