Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix QueryBuilderTest::testBatchInsert() #283

Merged
merged 4 commits into from
Dec 7, 2023
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
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
Loading