/** * @covers ::whereFunc */ public function testWhereFunc() { $b = new WhereBuilder(); $b->root('Author'); $b->whereFunc(DB::avg('age'), '>', 30); $components = $b->build(); $expr = new FuncExpr('age', 'AVG'); $expr->setValue(['age']); $where = [['type' => 'Basic', 'table' => '_', 'cols' => [$expr], 'op' => '>', 'val' => 30, 'logic' => 'AND', 'not' => false]]; $this->assertEquals($where, $components['where']); }