From 14bb2eed1b7efe6930027d9cfe5631e8ceb9059c Mon Sep 17 00:00:00 2001 From: Tigrov Date: Tue, 13 May 2025 11:42:13 +0700 Subject: [PATCH 1/2] Refactor `Command::insertWithReturningPks()` method --- src/Command.php | 29 +++-- src/DMLQueryBuilder.php | 17 ++- tests/CommandTest.php | 127 +++++++-------------- tests/QueryBuilderTest.php | 201 +++++----------------------------- tests/Support/Fixture/oci.sql | 2 +- 5 files changed, 101 insertions(+), 275 deletions(-) diff --git a/src/Command.php b/src/Command.php index 8fd58a4..9f3f351 100644 --- a/src/Command.php +++ b/src/Command.php @@ -8,9 +8,11 @@ use Yiisoft\Db\Constant\DataType; use Yiisoft\Db\Constant\PhpType; use Yiisoft\Db\Driver\Pdo\AbstractPdoCommand; +use Yiisoft\Db\Query\QueryInterface; use Yiisoft\Db\QueryBuilder\AbstractQueryBuilder; use function array_keys; +use function array_map; use function count; use function implode; use function strlen; @@ -21,7 +23,7 @@ */ final class Command extends AbstractPdoCommand { - public function insertWithReturningPks(string $table, array $columns): array|false + public function insertWithReturningPks(string $table, array|QueryInterface $columns): array|false { $tableSchema = $this->db->getSchema()->getTableSchema($table); $returnColumns = $tableSchema?->getPrimaryKey() ?? []; @@ -37,9 +39,9 @@ public function insertWithReturningPks(string $table, array $columns): array|fal $params = []; $sql = $this->getQueryBuilder()->insert($table, $columns, $params); - $tableColumns = $tableSchema?->getColumns() ?? []; + /** @var TableSchema $tableSchema */ + $tableColumns = $tableSchema->getColumns(); $returnParams = []; - $returning = []; foreach ($returnColumns as $name) { $phName = AbstractQueryBuilder::PARAM_PREFIX . (count($params) + count($returnParams)); @@ -49,18 +51,20 @@ public function insertWithReturningPks(string $table, array $columns): array|fal 'value' => '', ]; - if (!isset($tableColumns[$name]) || $tableColumns[$name]->getPhpType() !== PhpType::INT) { + $column = $tableColumns[$name]; + + if ($column->getPhpType() !== PhpType::INT) { $returnParams[$phName]['dataType'] = PDO::PARAM_STR; } else { $returnParams[$phName]['dataType'] = PDO::PARAM_INT; } - $returnParams[$phName]['size'] = ($tableColumns[$name]?->getSize() ?? 3998) + 2; - - $returning[] = $this->db->getQuoter()->quoteColumnName($name); + $returnParams[$phName]['size'] = ($column->getSize() ?? 3998) + 2; } - $sql .= ' RETURNING ' . implode(', ', $returning) . ' INTO ' . implode(', ', array_keys($returnParams)); + $quotedReturnColumns = array_map($this->db->getQuoter()->quoteColumnName(...), $returnColumns); + + $sql .= ' RETURNING ' . implode(', ', $quotedReturnColumns) . ' INTO ' . implode(', ', array_keys($returnParams)); $this->setSql($sql)->bindValues($params); $this->prepare(false); @@ -72,17 +76,22 @@ public function insertWithReturningPks(string $table, array $columns): array|fal unset($value); - if (!$this->execute()) { + if ($this->execute() === 0) { return false; } $result = []; foreach ($returnParams as $value) { - /** @psalm-var mixed */ $result[$value['column']] = $value['value']; } + if ($this->phpTypecasting) { + foreach ($result as $column => &$value) { + $value = $tableColumns[$column]->phpTypecast($value); + } + } + return $result; } diff --git a/src/DMLQueryBuilder.php b/src/DMLQueryBuilder.php index a437df7..b5f8aad 100644 --- a/src/DMLQueryBuilder.php +++ b/src/DMLQueryBuilder.php @@ -49,7 +49,7 @@ public function insertBatch(string $table, iterable $rows, array $columns = [], return $query . "\nSELECT " . implode(" FROM DUAL UNION ALL\nSELECT ", $values) . ' FROM DUAL'; } - public function insertWithReturningPks(string $table, QueryInterface|array $columns, array &$params = []): string + public function insertWithReturningPks(string $table, array|QueryInterface $columns, array &$params = []): string { throw new NotSupportedException(__METHOD__ . ' is not supported by Oracle.'); } @@ -59,9 +59,9 @@ public function insertWithReturningPks(string $table, QueryInterface|array $colu */ public function upsert( string $table, - QueryInterface|array $insertColumns, - array|bool $updateColumns, - array &$params = [] + array|QueryInterface $insertColumns, + array|bool $updateColumns = true, + array &$params = [], ): string { $constraints = []; @@ -134,6 +134,15 @@ public function upsert( return "$mergeSql WHEN MATCHED THEN $updateSql WHEN NOT MATCHED THEN $insertSql"; } + public function upsertWithReturningPks( + string $table, + array|QueryInterface $insertColumns, + array|bool $updateColumns = true, + array &$params = [], + ): string { + throw new NotSupportedException(__METHOD__ . ' is not supported by Oracle.'); + } + protected function prepareInsertValues(string $table, array|QueryInterface $columns, array $params = []): array { if (empty($columns)) { diff --git a/tests/CommandTest.php b/tests/CommandTest.php index dfcad45..d5d5704 100644 --- a/tests/CommandTest.php +++ b/tests/CommandTest.php @@ -30,8 +30,6 @@ /** * @group oracle - * - * @psalm-suppress PropertyNotSetInConstructor */ final class CommandTest extends CommonCommandTest { @@ -39,10 +37,6 @@ final class CommandTest extends CommonCommandTest protected string $upsertTestCharCast = 'CAST([[address]] AS VARCHAR(255))'; - /** - * @throws Exception - * @throws InvalidConfigException - */ public function testAddDefaultValue(): void { $db = $this->getConnection(); @@ -108,11 +102,6 @@ public function testBatchInsertWithAutoincrement(): void $db->close(); } - /** - * @throws Exception - * @throws InvalidConfigException - * @throws Throwable - */ public function testCLOBStringInsertion(): void { $db = $this->getConnection(); @@ -142,11 +131,6 @@ public function testCLOBStringInsertion(): void $db->close(); } - /** - * @throws Exception - * @throws InvalidConfigException - * @throws Throwable - */ public function testCreateTable(): void { $db = $this->getConnection(true); @@ -188,11 +172,6 @@ public function testCreateTable(): void $db->close(); } - /** - * @throws Exception - * @throws InvalidConfigException - * @throws Throwable - */ public function testCreateView(): void { $db = $this->getConnection(); @@ -251,10 +230,6 @@ public function testCreateView(): void $db->close(); } - /** - * @throws Exception - * @throws InvalidConfigException - */ public function testDropDefaultValue(): void { $db = $this->getConnection(); @@ -288,12 +263,6 @@ public function testDropTableIfExistsWithNonExistTable(): void $this->markTestSkipped('Oracle doesn\'t support "IF EXISTS" option on drop table.'); } - /** - * @throws Exception - * @throws InvalidConfigException - * @throws ReflectionException - * @throws Throwable - */ public function testExecuteWithTransaction(): void { $db = $this->getConnection(true); @@ -345,24 +314,12 @@ public function testExecuteWithTransaction(): void $db->close(); } - /** - * @dataProvider \Yiisoft\Db\Oracle\Tests\Provider\CommandProvider::rawSql - * - * @throws Exception - * @throws InvalidConfigException - * @throws NotSupportedException - */ + #[DataProviderExternal(CommandProvider::class, 'rawSql')] public function testGetRawSql(string $sql, array $params, string $expectedRawSql): void { parent::testGetRawSql($sql, $params, $expectedRawSql); } - /** - * @throws Exception - * @throws InvalidCallException - * @throws InvalidConfigException - * @throws Throwable - */ public function testsInsertQueryAsColumnValue(): void { $db = $this->getConnection(true); @@ -399,12 +356,6 @@ public function testsInsertQueryAsColumnValue(): void $db->close(); } - /** - * @throws Exception - * @throws InvalidCallException - * @throws InvalidConfigException - * @throws Throwable - */ public function testInsertWithReturningPksWithPrimaryKeyString(): void { $db = $this->getConnection(); @@ -451,11 +402,6 @@ public function testInsertWithReturningPksWithPrimaryKeySignedDecimal(): void $db->close(); } - /** - * @throws Exception - * @throws InvalidConfigException - * @throws Throwable - */ public function testInsertSelectAlias(): void { $db = $this->getConnection(); @@ -510,13 +456,7 @@ public function testInsertSelectAlias(): void $db->close(); } - /** - * @dataProvider \Yiisoft\Db\Oracle\Tests\Provider\CommandProvider::insertVarbinary - * - * @throws Exception - * @throws InvalidConfigException - * @throws Throwable - */ + #[DataProviderExternal(CommandProvider::class, 'insertVarbinary')] public function testInsertVarbinary(mixed $expectedData, mixed $testData): void { $db = $this->getConnection(true); @@ -537,12 +477,6 @@ public function testInsertVarbinary(mixed $expectedData, mixed $testData): void $db->close(); } - /** - * @throws Exception - * @throws InvalidCallException - * @throws InvalidConfigException - * @throws Throwable - */ public function testNoTablenameReplacement(): void { $db = $this->getConnection(true); @@ -592,13 +526,7 @@ public function testNoTablenameReplacement(): void $db->close(); } - /** - * @dataProvider \Yiisoft\Db\Oracle\Tests\Provider\CommandProvider::update - * - * @throws Exception - * @throws InvalidConfigException - * @throws Throwable - */ + #[DataProviderExternal(CommandProvider::class, 'update')] public function testUpdate( string $table, array $columns, @@ -610,25 +538,46 @@ public function testUpdate( parent::testUpdate($table, $columns, $conditions, $params, $expectedValues, $expectedCount); } - /** - * @dataProvider \Yiisoft\Db\Oracle\Tests\Provider\CommandProvider::upsert - * - * @throws Exception - * @throws InvalidConfigException - * @throws Throwable - */ + #[DataProviderExternal(CommandProvider::class, 'upsert')] public function testUpsert(array $firstData, array $secondData): void { parent::testUpsert($firstData, $secondData); } - /** - * @throws InvalidConfigException - * @throws InvalidArgumentException - * @throws NotSupportedException - * @throws Exception - * @throws Throwable - */ + public function testUpsertWithReturningPks(): void + { + $db = $this->getConnection(); + $command = $db->createCommand(); + + $this->expectException(NotSupportedException::class); + $this->expectExceptionMessage('Yiisoft\Db\Oracle\DMLQueryBuilder::upsertWithReturningPks is not supported by Oracle.'); + + $command->upsertWithReturningPks('{{customer}}', ['name' => 'test_1', 'email' => 'test_1@example.com']); + } + + public function testUpsertWithReturningPksEmptyValues() + { + $db = $this->getConnection(); + $command = $db->createCommand(); + + $this->expectException(NotSupportedException::class); + $this->expectExceptionMessage('Yiisoft\Db\Oracle\DMLQueryBuilder::upsertWithReturningPks is not supported by Oracle.'); + + $command->upsertWithReturningPks('null_values', []); + } + + public function testUpsertWithReturningPksWithPhpTypecasting(): void + { + $db = $this->getConnection(); + + $this->expectException(NotSupportedException::class); + $this->expectExceptionMessage('Yiisoft\Db\Oracle\DMLQueryBuilder::upsertWithReturningPks is not supported by Oracle.'); + + $db->createCommand() + ->withPhpTypecasting() + ->upsertWithReturningPks('notauto_pk', ['id_1' => 1, 'id_2' => 2.5, 'type' => 'test1']); + } + public function testQueryScalarWithBlob(): void { $db = $this->getConnection(true); diff --git a/tests/QueryBuilderTest.php b/tests/QueryBuilderTest.php index d8933ab..162091f 100644 --- a/tests/QueryBuilderTest.php +++ b/tests/QueryBuilderTest.php @@ -21,8 +21,6 @@ /** * @group oracle - * - * @psalm-suppress PropertyNotSetInConstructor */ final class QueryBuilderTest extends CommonQueryBuilderTest { @@ -33,10 +31,6 @@ public function getBuildColumnDefinitionProvider(): array return QueryBuilderProvider::buildColumnDefinition(); } - /** - * @throws Exception - * @throws InvalidConfigException - */ public function testAddDefaultValue(): void { $db = $this->getConnection(); @@ -49,14 +43,7 @@ public function testAddDefaultValue(): void $qb->addDefaultValue('T_constraints_1', 'CN_pk', 'C_default', 1); } - /** - * @dataProvider \Yiisoft\Db\Oracle\Tests\Provider\QueryBuilderProvider::addForeignKey - * - * @throws Exception - * @throws InvalidConfigException - * @throws NotSupportedException - * @throws InvalidArgumentException - */ + #[DataProviderExternal(QueryBuilderProvider::class, 'addForeignKey')] public function testAddForeignKey( string $name, string $table, @@ -71,11 +58,6 @@ public function testAddForeignKey( parent::testAddForeignKey($name, $table, $columns, $refTable, $refColumns, $delete, null, $expected); } - /** - * @throws InvalidConfigException - * @throws InvalidArgumentException - * @throws Exception - */ public function testAddForeignKeyUpdateException(): void { $db = $this->getConnection(); @@ -88,17 +70,13 @@ public function testAddForeignKeyUpdateException(): void $qb->addForeignKey('T_constraints_1', 'fk1', 'C_fk1', 'T_constraints_2', 'C_fk2', 'CASCADE', 'CASCADE'); } - /** - * @dataProvider \Yiisoft\Db\Oracle\Tests\Provider\QueryBuilderProvider::addPrimaryKey - */ + #[DataProviderExternal(QueryBuilderProvider::class, 'addPrimaryKey')] public function testAddPrimaryKey(string $name, string $table, array|string $columns, string $expected): void { parent::testAddPrimaryKey($name, $table, $columns, $expected); } - /** - * @dataProvider \Yiisoft\Db\Oracle\Tests\Provider\QueryBuilderProvider::addUnique - */ + #[DataProviderExternal(QueryBuilderProvider::class, 'addUnique')] public function testAddUnique(string $name, string $table, array|string $columns, string $expected): void { parent::testAddUnique($name, $table, $columns, $expected); @@ -110,14 +88,7 @@ public function testAlterColumn(string|ColumnInterface $type, string $expected): parent::testAlterColumn($type, $expected); } - /** - * @dataProvider \Yiisoft\Db\Oracle\Tests\Provider\QueryBuilderProvider::batchInsert - * - * @throws Exception - * @throws InvalidConfigException - * @throws InvalidArgumentException - * @throws NotSupportedException - */ + #[DataProviderExternal(QueryBuilderProvider::class, 'batchInsert')] public function testBatchInsert( string $table, iterable $rows, @@ -137,14 +108,7 @@ public function testBuildCondition( parent::testBuildCondition($condition, $expected, $expectedParams); } - /** - * @dataProvider \Yiisoft\Db\Oracle\Tests\Provider\QueryBuilderProvider::buildLikeCondition - * - * @throws Exception - * @throws InvalidConfigException - * @throws InvalidArgumentException - * @throws NotSupportedException - */ + #[DataProviderExternal(QueryBuilderProvider::class, 'buildLikeCondition')] public function testBuildLikeCondition( array|ExpressionInterface $condition, string $expected, @@ -153,11 +117,6 @@ public function testBuildLikeCondition( parent::testBuildLikeCondition($condition, $expected, $expectedParams); } - /** - * @throws Exception - * @throws InvalidArgumentException - * @throws InvalidConfigException - */ public function testBuildOrderByAndLimit(): void { $db = $this->getConnection(); @@ -187,25 +146,12 @@ public function testBuildOrderByAndLimit(): void $db->close(); } - /** - * @dataProvider \Yiisoft\Db\Oracle\Tests\Provider\QueryBuilderProvider::buildFrom - * - * @throws Exception - * @throws InvalidConfigException - * @throws InvalidArgumentException - * @throws NotSupportedException - */ + #[DataProviderExternal(QueryBuilderProvider::class, 'buildFrom')] public function testBuildWithFrom(mixed $table, string $expectedSql, array $expectedParams = []): void { parent::testBuildWithFrom($table, $expectedSql, $expectedParams); } - /** - * @throws Exception - * @throws InvalidConfigException - * @throws InvalidArgumentException - * @throws NotSupportedException - */ public function testBuildWithLimit(): void { $db = $this->getConnection(); @@ -227,12 +173,6 @@ public function testBuildWithLimit(): void $db->close(); } - /** - * @throws Exception - * @throws InvalidConfigException - * @throws InvalidArgumentException - * @throws NotSupportedException - */ public function testBuildWithOffset(): void { $db = $this->getConnection(); @@ -254,23 +194,12 @@ public function testBuildWithOffset(): void $db->close(); } - /** - * @dataProvider \Yiisoft\Db\Oracle\Tests\Provider\QueryBuilderProvider::buildWhereExists - * - * @throws Exception - * @throws InvalidConfigException - * @throws InvalidArgumentException - * @throws NotSupportedException - */ + #[DataProviderExternal(QueryBuilderProvider::class, 'buildWhereExists')] public function testBuildWithWhereExists(string $cond, string $expectedQuerySql): void { parent::testBuildWithWhereExists($cond, $expectedQuerySql); } - /** - * @throws Exception - * @throws NotSupportedException - */ public function testCheckIntegrity(): void { $db = $this->getConnection(); @@ -283,10 +212,6 @@ public function testCheckIntegrity(): void $qb->checkIntegrity('', 'customer'); } - /** - * @throws Exception - * @throws InvalidConfigException - */ public function testCreateTable(): void { $db = $this->getConnection(); @@ -318,23 +243,12 @@ public function testCreateTable(): void $db->close(); } - /** - * @dataProvider \Yiisoft\Db\Oracle\Tests\Provider\QueryBuilderProvider::delete - * - * @throws Exception - * @throws InvalidConfigException - * @throws InvalidArgumentException - * @throws NotSupportedException - */ + #[DataProviderExternal(QueryBuilderProvider::class, 'delete')] public function testDelete(string $table, array|string $condition, string $expectedSQL, array $expectedParams): void { parent::testDelete($table, $condition, $expectedSQL, $expectedParams); } - /** - * @throws Exception - * @throws InvalidConfigException - */ public function testDropCommentFromColumn(): void { $db = $this->getConnection(true); @@ -351,10 +265,6 @@ public function testDropCommentFromColumn(): void $db->close(); } - /** - * @throws Exception - * @throws InvalidConfigException - */ public function testDropCommentFromTable(): void { $db = $this->getConnection(); @@ -371,10 +281,6 @@ public function testDropCommentFromTable(): void $db->close(); } - /** - * @throws Exception - * @throws InvalidConfigException - */ public function testDropDefaultValue(): void { $db = $this->getConnection(true); @@ -389,10 +295,6 @@ public function testDropDefaultValue(): void $qb->dropDefaultValue('T_constraints_1', 'CN_pk'); } - /** - * @throws Exception - * @throws InvalidConfigException - */ public function testDropIndex(): void { $db = $this->getConnection(); @@ -409,14 +311,7 @@ public function testDropIndex(): void $db->close(); } - /** - * @dataProvider \Yiisoft\Db\Oracle\Tests\Provider\QueryBuilderProvider::insert - * - * @throws Exception - * @throws InvalidConfigException - * @throws InvalidArgumentException - * @throws NotSupportedException - */ + #[DataProviderExternal(QueryBuilderProvider::class, 'insert')] public function testInsert( string $table, array|QueryInterface $columns, @@ -427,13 +322,7 @@ public function testInsert( parent::testInsert($table, $columns, $params, $expectedSQL, $expectedParams); } - /** - * @dataProvider \Yiisoft\Db\Oracle\Tests\Provider\QueryBuilderProvider::insertWithReturningPks - * - * @throws Exception - * @throws InvalidConfigException - * @throws NotSupportedException - */ + #[DataProviderExternal(QueryBuilderProvider::class, 'insertWithReturningPks')] public function testInsertWithReturningPks( string $table, array|QueryInterface $columns, @@ -451,10 +340,6 @@ public function testInsertWithReturningPks( $qb->insertWithReturningPks($table, $columns, $params); } - /** - * @throws Exception - * @throws InvalidConfigException - */ public function testRenameTable(): void { $db = $this->getConnection(); @@ -471,12 +356,6 @@ public function testRenameTable(): void $db->close(); } - /** - * @throws Exception - * @throws InvalidConfigException - * @throws NotSupportedException - * @throws Throwable - */ public function testResetSequence(): void { $db = $this->getConnection(true); @@ -548,11 +427,6 @@ public function testResetSequence(): void $db->close(); } - /** - * @throws Exception - * @throws InvalidConfigException - * @throws NotSupportedException - */ public function testResetNonExistSequenceException(): void { $db = $this->getConnection(true); @@ -579,22 +453,13 @@ public function testResetSequenceCompositeException(): void $db->close(); } - /** - * @dataProvider \Yiisoft\Db\Oracle\Tests\Provider\QueryBuilderProvider::selectExist - */ + #[DataProviderExternal(QueryBuilderProvider::class, 'selectExist')] public function testSelectExists(string $sql, string $expected): void { parent::testSelectExists($sql, $expected); } - /** - * @dataProvider \Yiisoft\Db\Oracle\Tests\Provider\QueryBuilderProvider::update - * - * @throws Exception - * @throws InvalidConfigException - * @throws NotSupportedException - * @throws Throwable - */ + #[DataProviderExternal(QueryBuilderProvider::class, 'update')] public function testUpdate( string $table, array $columns, @@ -606,38 +471,32 @@ public function testUpdate( parent::testUpdate($table, $columns, $condition, $params, $expectedSql, $expectedParams); } - /** - * @dataProvider \Yiisoft\Db\Oracle\Tests\Provider\QueryBuilderProvider::upsert - * - * @throws Exception - * @throws InvalidConfigException - * @throws NotSupportedException - * @throws Throwable - */ + #[DataProviderExternal(QueryBuilderProvider::class, 'upsert')] public function testUpsert( string $table, array|QueryInterface $insertColumns, array|bool $updateColumns, - string $expectedSQL, + string $expectedSql, array $expectedParams ): void { - parent::testUpsert($table, $insertColumns, $updateColumns, $expectedSQL, $expectedParams); - } - - /** - * @dataProvider \Yiisoft\Db\Oracle\Tests\Provider\QueryBuilderProvider::upsert - * - * @throws Exception - * @throws InvalidConfigException - * @throws NotSupportedException - * @throws Throwable - */ - public function testUpsertExecute( + parent::testUpsert($table, $insertColumns, $updateColumns, $expectedSql, $expectedParams); + } + + #[DataProviderExternal(QueryBuilderProvider::class, 'upsertWithReturningPks')] + public function testUpsertWithReturningPks( string $table, array|QueryInterface $insertColumns, - array|bool $updateColumns + array|bool $updateColumns, + string $expectedSql, + array $expectedParams ): void { - parent::testUpsertExecute($table, $insertColumns, $updateColumns); + $db = $this->getConnection(); + $qb = $db->getQueryBuilder(); + + $this->expectException(NotSupportedException::class); + $this->expectExceptionMessage('Yiisoft\Db\Oracle\DMLQueryBuilder::upsertWithReturningPks is not supported by Oracle.'); + + $qb->upsertWithReturningPks($table, $insertColumns, $updateColumns); } public function testDefaultValues(): void @@ -652,7 +511,7 @@ public function testDefaultValues(): void ); } - /** @dataProvider \Yiisoft\Db\Oracle\Tests\Provider\QueryBuilderProvider::selectScalar */ + #[DataProviderExternal(QueryBuilderProvider::class, 'selectScalar')] public function testSelectScalar(array|bool|float|int|string $columns, string $expected): void { parent::testSelectScalar($columns, $expected); diff --git a/tests/Support/Fixture/oci.sql b/tests/Support/Fixture/oci.sql index 0bd45a1..ee06eef 100644 --- a/tests/Support/Fixture/oci.sql +++ b/tests/Support/Fixture/oci.sql @@ -210,7 +210,7 @@ CREATE TABLE "default_pk" ( CREATE TABLE "notauto_pk" ( "id_1" INTEGER, - "id_2" INTEGER, + "id_2" DECIMAL(5,2), "type" VARCHAR2(255) NOT NULL, CONSTRAINT "notauto_pk_PK" PRIMARY KEY ("id_1", "id_2") ENABLE ); From 5092fe5b3f67ac0404a5fab9e201b348d6fb3355 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Tue, 13 May 2025 04:43:33 +0000 Subject: [PATCH 2/2] Apply fixes from StyleCI --- tests/CommandTest.php | 5 ----- tests/QueryBuilderTest.php | 2 -- 2 files changed, 7 deletions(-) diff --git a/tests/CommandTest.php b/tests/CommandTest.php index d5d5704..1241e1d 100644 --- a/tests/CommandTest.php +++ b/tests/CommandTest.php @@ -5,14 +5,9 @@ namespace Yiisoft\Db\Oracle\Tests; use PHPUnit\Framework\Attributes\DataProviderExternal; -use ReflectionException; -use Throwable; use Yiisoft\Db\Constant\ColumnType; use Yiisoft\Db\Constant\PseudoType; use Yiisoft\Db\Exception\Exception; -use Yiisoft\Db\Exception\InvalidArgumentException; -use Yiisoft\Db\Exception\InvalidCallException; -use Yiisoft\Db\Exception\InvalidConfigException; use Yiisoft\Db\Exception\NotSupportedException; use Yiisoft\Db\Oracle\Column\ColumnBuilder; use Yiisoft\Db\Oracle\IndexType; diff --git a/tests/QueryBuilderTest.php b/tests/QueryBuilderTest.php index 162091f..f93148b 100644 --- a/tests/QueryBuilderTest.php +++ b/tests/QueryBuilderTest.php @@ -6,10 +6,8 @@ use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\DataProviderExternal; -use Throwable; use Yiisoft\Db\Exception\Exception; use Yiisoft\Db\Exception\InvalidArgumentException; -use Yiisoft\Db\Exception\InvalidConfigException; use Yiisoft\Db\Exception\NotSupportedException; use Yiisoft\Db\Expression\ExpressionInterface; use Yiisoft\Db\Oracle\Tests\Provider\QueryBuilderProvider;