Skip to content

Commit

Permalink
Fix QueryBuilderTest::testBatchInsert() (yiisoft#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov authored Dec 7, 2023
1 parent ebb4645 commit 1ae3f3d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
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

0 comments on commit 1ae3f3d

Please sign in to comment.