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() #249

Merged
merged 3 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
4 changes: 0 additions & 4 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\Php71\Rector\FuncCall\CountOnNullRector;
use Rector\Php73\Rector\String_\SensitiveHereNowDocRector;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
use Rector\Set\ValueObject\LevelSetList;
Expand All @@ -26,8 +25,5 @@
$rectorConfig->skip([
ClosureToArrowFunctionRector::class,
SensitiveHereNowDocRector::class,
CountOnNullRector::class => [
'src/Command.php',
],
]);
};
7 changes: 7 additions & 0 deletions tests/Provider/QueryBuilderProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ public static function batchInsert(): array
DbHelper::changeSqlForOracleBatchInsert($batchInsert['bool-false, time-now()']['expected']);
DbHelper::changeSqlForOracleBatchInsert($batchInsert['column table names are not checked']['expected']);

$batchInsert['bool-false, bool2-null']['expectedParams'][':qp0'] = '0';
$batchInsert['bool-false, time-now()']['expectedParams'][':qp0'] = '0';
$batchInsert['column table names are not checked']['expectedParams'] = [
':qp0' => '1',
':qp1' => '0',
];

return $batchInsert;
}

Expand Down
11 changes: 8 additions & 3 deletions tests/QueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,14 @@ public function testAlterColumn(): void
* @throws InvalidArgumentException
* @throws NotSupportedException
*/
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