Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/QueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -574,23 +574,23 @@ 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,
string $expectedSQL,
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);
}

/**
Expand Down
8 changes: 8 additions & 0 deletions tests/Support/Fixture/sqlite.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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');
Expand Down