ajout méthodes random,index dans la collection, ajout clause distinct, whereNull , whereNotNull dans le querybuilder

This commit is contained in:
Gregory Letellier
2023-11-02 10:27:06 +01:00
parent fe6d2f27b8
commit 84bf765b84
5 changed files with 79 additions and 3 deletions

View File

@@ -14,6 +14,8 @@ test("collection", function () {
expect($coll->count())->toBe(11);
expect($coll->first())->toBe(0);
expect($coll->last())->toBe(10);
expect($coll->index(1))->toBe(1);
expect($coll->random())->toBeGreaterThanOrEqual(0)->toBeLessThanOrEqual(11);
$filt = $coll->filter(function($item){ return $item<5;});
expect($filt)->toBeInstanceOf(Collection::class);