ajout des conditions where in et where between

This commit is contained in:
2023-10-29 18:37:35 +01:00
parent dad85948e5
commit 68de5a7d96
4 changed files with 52 additions and 2 deletions

View File

@@ -110,4 +110,31 @@ test("event", function() {
$qb->find(1);
expect($ret)->toBeObject();
});
test("where array", function() {
$row3 = new Model();
$row3->setTable("test");
$row3->col1 = "test3";
$row3->date1 = new \DateTime();
$ret3 = $row3->save();
$qb = new QueryBuilder("test");
$all = $qb->get();
expect(count($all))->toBe(3);
$qb->reset();
$between = $qb->whereBetween("id",2,3)->get();
expect(count($between))->toBe(2);
expect($between[0]->id)->toBe(2);
$qb->reset();
$in = $qb->whereIn("id",[2,3])->get();
expect(count($in))->toBe(2);
expect($in[0]->id)->toBe(2);
});