Skip to content

Commit ffa4395

Browse files
committed
Added tests
1 parent 7c899dc commit ffa4395

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/system/Models/MiscellaneousModelTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,20 @@ public function testChunk(): void
3939
$this->assertSame(4, $rowCount);
4040
}
4141

42+
public function testChunkArray(): void
43+
{
44+
$chunkCount = 0;
45+
$numRowsInChunk = [];
46+
47+
$this->createModel(UserModel::class)->chunkArray(2, static function ($rows) use (&$chunkCount, &$numRowsInChunk): void {
48+
$chunkCount++;
49+
$numRowsInChunk[] = count($rows);
50+
});
51+
52+
$this->assertSame(2, $chunkCount);
53+
$this->assertSame([2, 2], $numRowsInChunk);
54+
}
55+
4256
public function testCanCreateAndSaveEntityClasses(): void
4357
{
4458
$entity = $this->createModel(EntityModel::class)->where('name', 'Developer')->first();

0 commit comments

Comments
 (0)