From 29fbc251ed02812420a7a58da79a28adc2e680b0 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Wed, 3 Dec 2025 12:56:16 +0300 Subject: [PATCH] fix --- tests/Provider/ColumnFactoryProvider.php | 4 ++-- tests/Provider/QueryBuilderProvider.php | 9 +++++---- tests/Provider/SchemaProvider.php | 4 ++-- tests/QueryBuilderTest.php | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/Provider/ColumnFactoryProvider.php b/tests/Provider/ColumnFactoryProvider.php index cc09a3fb..851c56cf 100644 --- a/tests/Provider/ColumnFactoryProvider.php +++ b/tests/Provider/ColumnFactoryProvider.php @@ -33,8 +33,8 @@ public static function dbTypes(): array ['float', ColumnType::FLOAT, DoubleColumn::class], ['real', ColumnType::FLOAT, DoubleColumn::class], ['double', ColumnType::DOUBLE, DoubleColumn::class], - ['decimal', ColumnType::DECIMAL, DoubleColumn::class], - ['numeric', ColumnType::DECIMAL, DoubleColumn::class], + ['decimal', ColumnType::DECIMAL, StringColumn::class], + ['numeric', ColumnType::DECIMAL, StringColumn::class], ['char', ColumnType::CHAR, StringColumn::class], ['varchar', ColumnType::STRING, StringColumn::class], ['string', ColumnType::STRING, StringColumn::class], diff --git a/tests/Provider/QueryBuilderProvider.php b/tests/Provider/QueryBuilderProvider.php index 9e2d2a02..32a68987 100644 --- a/tests/Provider/QueryBuilderProvider.php +++ b/tests/Provider/QueryBuilderProvider.php @@ -17,6 +17,7 @@ use function array_replace; use function array_splice; +use function in_array; use function strtr; final class QueryBuilderProvider extends \Yiisoft\Db\Tests\Provider\QueryBuilderProvider @@ -197,9 +198,9 @@ public static function insertReturningPks(): array ['order_id' => 1, 'item_id' => 1, 'quantity' => 1, 'subtotal' => 1.0], [], << new Param('1', DataType::STRING)], ], ]; } @@ -324,9 +325,9 @@ public static function upsertReturning(): array ['id_1' => 1, 'id_2' => 2.5, 'type' => 'Test'], true, ['id_1', 'id_2'], - 'INSERT INTO "notauto_pk" ("id_1", "id_2", "type") VALUES (1, 2.5, :qp0)' + 'INSERT INTO "notauto_pk" ("id_1", "id_2", "type") VALUES (1, :qp0, :qp1)' . ' ON CONFLICT ("id_1", "id_2") DO UPDATE SET "type"=EXCLUDED."type" RETURNING "id_1", "id_2"', - [':qp0' => new Param('Test', DataType::STRING)], + [':qp0' => new Param('2.5', DataType::STRING), ':qp1' => new Param('Test', DataType::STRING)], ], 'no return columns' => [ 'type', diff --git a/tests/Provider/SchemaProvider.php b/tests/Provider/SchemaProvider.php index 0b8c2049..e3f0eaa5 100644 --- a/tests/Provider/SchemaProvider.php +++ b/tests/Provider/SchemaProvider.php @@ -74,12 +74,12 @@ public static function columns(): array 'blob_col' => new BinaryColumn( dbType: 'blob', ), - 'numeric_col' => new DoubleColumn( + 'numeric_col' => new StringColumn( ColumnType::DECIMAL, dbType: 'decimal', size: 5, scale: 2, - defaultValue: 33.22, + defaultValue: '33.22', ), 'timestamp_col' => new DatetimeColumn( ColumnType::TIMESTAMP, diff --git a/tests/QueryBuilderTest.php b/tests/QueryBuilderTest.php index 172484f0..dbd2ec7b 100644 --- a/tests/QueryBuilderTest.php +++ b/tests/QueryBuilderTest.php @@ -521,10 +521,10 @@ public function testInsertReturningPks( string $table, Closure|array|QueryInterface $columns, array $params, - string $expectedSQL, + string $expectedSql, array $expectedParams, ): void { - parent::testInsertReturningPks($table, $columns, $params, $expectedSQL, $expectedParams); + parent::testInsertReturningPks($table, $columns, $params, $expectedSql, $expectedParams); } public function testRenameColumn(): void