Skip to content

Commit c5286d1

Browse files
committed
test: add test for insertBatch() to table without auto-increment key
1 parent 87454e6 commit c5286d1

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

tests/system/Models/InsertModelTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,26 @@ public function testInsertBatchSuccess(): void
6565
$this->seeInDatabase('job', ['name' => 'Cab Driver']);
6666
}
6767

68+
public function testInsertBatchUseAutoIncrementSetToFalse(): void
69+
{
70+
$insertData = [
71+
[
72+
'key' => 'key1',
73+
'value' => 'value1',
74+
],
75+
[
76+
'key' => 'key2',
77+
'value' => 'value2',
78+
],
79+
];
80+
81+
$this->createModel(WithoutAutoIncrementModel::class);
82+
$this->model->insertBatch($insertData);
83+
84+
$this->seeInDatabase('without_auto_increment', ['key' => 'key1']);
85+
$this->seeInDatabase('without_auto_increment', ['key' => 'key2']);
86+
}
87+
6888
public function testInsertBatchValidationFail(): void
6989
{
7090
$jobData = [

0 commit comments

Comments
 (0)