From ed3d4ad2a758b8552057280927717ce8f93532ea Mon Sep 17 00:00:00 2001 From: KalimeroMK Date: Sun, 2 Aug 2026 18:21:48 +0200 Subject: [PATCH 1/2] test: drop tests for removed schema-wide getters yiisoft/db removes getSchemaChecks(), getSchemaDefaultValues(), getSchemaIndexes(), getSchemaPrimaryKeys() and getSchemaUniques() from ConstraintSchemaInterface. The tests covering them here call the removed methods, so they can no longer run. Requires the corresponding yiisoft/db change. Refs yiisoft/db#1175 --- tests/SchemaTest.php | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/tests/SchemaTest.php b/tests/SchemaTest.php index fa585573e..4116c8c0a 100644 --- a/tests/SchemaTest.php +++ b/tests/SchemaTest.php @@ -109,18 +109,6 @@ public function testGetDefaultSchema(): void $this->assertSame('public', $schema->getDefaultSchema()); } - public function testGetSchemaDefaultValues(): void - { - $db = $this->getSharedConnection(); - - $this->expectException(NotSupportedException::class); - $this->expectExceptionMessage( - 'Yiisoft\Db\Pgsql\Schema::loadTableDefaultValues is not supported by PostgreSQL.', - ); - - $db->getSchema()->getSchemaDefaultValues(); - } - public function testGetSchemaNames(): void { $db = $this->getSharedConnection(); From a4cc7ff47ba17fb08c7598b0c8d84172b5084877 Mon Sep 17 00:00:00 2001 From: KalimeroMK Date: Sun, 2 Aug 2026 19:38:28 +0200 Subject: [PATCH 2/2] test: cover unsupported default values via getTableDefaultValues() The removed testGetSchemaDefaultValues() was the only test reaching the throw in Schema::loadTableDefaultValues(), so dropping it left that line uncovered. Exercise the same path through getTableDefaultValues(), which survives yiisoft/db#1175. Refs yiisoft/db#1175 --- tests/SchemaTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/SchemaTest.php b/tests/SchemaTest.php index 4116c8c0a..a96512b61 100644 --- a/tests/SchemaTest.php +++ b/tests/SchemaTest.php @@ -125,6 +125,18 @@ public function testGetSchemaNames(): void } } + public function testGetTableDefaultValues(): void + { + $db = $this->getSharedConnection(); + + $this->expectException(NotSupportedException::class); + $this->expectExceptionMessage( + 'Yiisoft\Db\Pgsql\Schema::loadTableDefaultValues is not supported by PostgreSQL.', + ); + + $db->getSchema()->getTableDefaultValues('customer'); + } + public function testGetTableSchemasNotSchemaDefault(): void { $db = $this->getSharedConnection();