Skip to content

Commit

Permalink
Improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Aug 21, 2023
1 parent ef2fa1b commit cab52c5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
17 changes: 17 additions & 0 deletions tests/Provider/CommandProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,23 @@ public static function batchInsert(): array
':qp3' => false,
],
],
'with associative values' => [
'type',
['int_col', 'float_col', 'char_col', 'bool_col'],
'values' => [['int' => '1.0', 'float' => '2', 'char' => 10, 'bool' => 1]],
'expected' => DbHelper::replaceQuotes(
<<<SQL
INSERT INTO [[type]] ([[int_col]], [[float_col]], [[char_col]], [[bool_col]]) VALUES (:qp0, :qp1, :qp2, :qp3)
SQL,
static::$driverName,
),
'expectedParams' => [
':qp0' => 1,
':qp1' => 2.0,
':qp2' => '10',
':qp3' => true,
],
],
];
}

Expand Down
12 changes: 0 additions & 12 deletions tests/Provider/QueryBuilderProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,18 +235,6 @@ public static function batchInsert(): array
})(),
'',
],
'with associative values' => [
'type',
['int_col', 'int_col2'],
[['first' => 1, 'second' => 2]],
'expected' => DbHelper::replaceQuotes(
<<<SQL
INSERT INTO [[type]] ([[int_col]], [[int_col2]]) VALUES (:qp0, :qp1)
SQL,
static::$driverName,
),
[':qp0' => 1, ':qp1' => 2],
],
];
}

Expand Down

0 comments on commit cab52c5

Please sign in to comment.