You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/QueryBuilderUnitTest.php
+24Lines changed: 24 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -252,6 +252,30 @@ public function testUpdateStatementBuild()
252
252
$this->db->reset();
253
253
}
254
254
255
+
publicfunctiontestUpdateBatchStatementBuild()
256
+
{
257
+
Parameters::reset();
258
+
$this->db->from('post')
259
+
->where('status', true);
260
+
261
+
$data = [
262
+
[
263
+
'id' => 5,
264
+
'title' => 'New Title #5',
265
+
'content' => 'New Content #5',
266
+
],
267
+
[
268
+
'id' => 10,
269
+
'title' => 'New Title #10',
270
+
]
271
+
];
272
+
273
+
$expected = 'UPDATE post SET title = CASE WHEN id = :id THEN :title WHEN id = :id_1 THEN :title_1 ELSE title END, content = CASE WHEN id = :id_2 THEN :content ELSE content END WHERE status = :status AND id IN (5, 10)';
0 commit comments