$result = $this->query->where(['name' => 'Foo Gallery'])->get(); expect(count($result))->toBe(1); }); }); describe("->conditions()", function () { it("filters out according conditions", function () { $this->fixtures->populate('gallery'); $result = $this->query->conditions(['name' => 'Foo Gallery'])->get(); expect(count($result))->toBe(1); }); }); describe("->group()", function () { it("groups by a field name", function () { $this->fixtures->populate('image'); $query = new Query(['model' => $this->image]); $result = $query->fields(['gallery_id'])->group('gallery_id')->get(); expect(count($result))->toBe(2); }); }); describe("->having()", function () { it("filters out according conditions", function () { $this->fixtures->populate('gallery'); $result = $this->query->fields(['name'])->group('name')->having(['name' => 'Foo Gallery'])->get(); expect(count($result))->toBe(1); }); }); describe("->order()", function () { it("order by a field name ASC", function () { $this->fixtures->populate('gallery'); $query = new Query(['model' => $this->gallery]); $entity = $query->order(['name' => 'ASC'])->first();