From ad48ec361260da02046cddc4ffe181a1d7c11622 Mon Sep 17 00:00:00 2001 From: darkdef Date: Thu, 5 Jan 2023 17:20:11 +0300 Subject: [PATCH 1/2] Add insertEx additional test + bugfix for oracle --- tests/Support/Fixture/sqlite.sql | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/Support/Fixture/sqlite.sql b/tests/Support/Fixture/sqlite.sql index d3b15f0bf..fc58d36f9 100644 --- a/tests/Support/Fixture/sqlite.sql +++ b/tests/Support/Fixture/sqlite.sql @@ -14,6 +14,7 @@ DROP TABLE IF EXISTS "null_values"; DROP TABLE IF EXISTS "negative_default_values"; DROP TABLE IF EXISTS "animal"; DROP TABLE IF EXISTS "default_pk"; +DROP TABLE IF EXISTS "notauto_pk"; DROP VIEW IF EXISTS "animal_view"; DROP TABLE IF EXISTS "T_constraints_4"; DROP TABLE IF EXISTS "T_constraints_3"; @@ -154,6 +155,13 @@ CREATE TABLE "default_pk" ( PRIMARY KEY (id) ); +CREATE TABLE "notauto_pk" ( + id_1 INTEGER, + id_2 INTEGER, + type VARCHAR(255) NOT NULL, + PRIMARY KEY (id_1, id_2) +); + CREATE VIEW "animal_view" AS SELECT * FROM "animal"; INSERT INTO "animal" ("type") VALUES ('yiiunit\data\ar\Cat'); From b4aab373310f80c325c0e042b4747d38049749b8 Mon Sep 17 00:00:00 2001 From: darkdef Date: Thu, 5 Jan 2023 18:33:40 +0300 Subject: [PATCH 2/2] Rename method insertEx. Part 2 --- tests/QueryBuilderTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/QueryBuilderTest.php b/tests/QueryBuilderTest.php index 1c64bf7ca..96a292841 100644 --- a/tests/QueryBuilderTest.php +++ b/tests/QueryBuilderTest.php @@ -574,11 +574,11 @@ public function testInsert( } /** - * @dataProvider \Yiisoft\Db\Sqlite\Tests\Provider\QueryBuilderProvider::insertEx() + * @dataProvider \Yiisoft\Db\Sqlite\Tests\Provider\QueryBuilderProvider::insertWithReturningPks() * * @throws Exception */ - public function testInsertEx( + public function testInsertWithReturningPks( string $table, array|QueryInterface $columns, array $params, @@ -586,11 +586,11 @@ public function testInsertEx( array $expectedParams ): void { $this->expectException(NotSupportedException::class); - $this->expectExceptionMessage('Yiisoft\Db\QueryBuilder\DMLQueryBuilder::insertEx() is not supported by this DBMS.'); + $this->expectExceptionMessage('Yiisoft\Db\QueryBuilder\DMLQueryBuilder::insertWithReturningPks() is not supported by this DBMS.'); $db = $this->getConnection(true); $qb = $db->getQueryBuilder(); - $qb->insertEx($table, $columns, $params); + $qb->insertWithReturningPks($table, $columns, $params); } /**