Skip to content

Commit

Permalink
Fix QueryBuilderTest::testBatchInsert() (#283)
Browse files Browse the repository at this point in the history
Co-authored-by: Sergei Predvoditelev <[email protected]>
  • Loading branch information
Tigrov and vjik authored Dec 7, 2023
1 parent fd45a0b commit 0992809
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Enh #281: Remove unused code in `Command` class (@vjik)
- Enh #282: Change property `Schema::$typeMap` to constant `Schema::TYPE_MAP` (@Tigrov)
- Enh #283: Remove unnecessary check for array type in `Schema::loadTableIndexes()` (@Tigrov)

## 1.1.0 November 12, 2023

Expand Down
7 changes: 3 additions & 4 deletions src/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,12 @@ protected function loadTableForeignKeys(string $tableName): array
*
* @return array Indexes for the given table.
*
* @psalm-return array|IndexConstraint[]
* @psalm-return IndexConstraint[]
*/
protected function loadTableIndexes(string $tableName): array
{
$tableIndexes = $this->loadTableConstraints($tableName, self::INDEXES);

return is_array($tableIndexes) ? $tableIndexes : [];
/** @var IndexConstraint[] */
return $this->loadTableConstraints($tableName, self::INDEXES);
}

/**
Expand Down
11 changes: 8 additions & 3 deletions tests/QueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,14 @@ public function testAlterColumn(): void
* @throws NotSupportedException
* @throws Throwable
*/
public function testBatchInsert(string $table, array $columns, iterable $rows, string $expected): void
{
parent::testBatchInsert($table, $columns, $rows, $expected);
public function testBatchInsert(
string $table,
array $columns,
iterable $rows,
string $expected,
array $expectedParams = [],
): void {
parent::testBatchInsert($table, $columns, $rows, $expected, $expectedParams);
}

/**
Expand Down

0 comments on commit 0992809

Please sign in to comment.