示例#1
0
 public function testArithmetic()
 {
     $this->assertEquals('(5 + (10 - 5))', QueryAssembler::stringify(AdditionExpression::create(5, SubtractExpression::create(10, 5))));
     $this->assertEquals('(SUM(amt) + (10 - 5))', QueryAssembler::stringify(AdditionExpression::create(SumSelectExpression::create('amt'), SubtractExpression::create(10, 5))));
 }
 public function testListExpression()
 {
     $this->assertEquals("['test',1]", CqlAssembler::stringify(ListExpression::create(['test', 1])));
     $this->assertEquals("\"testfield\" - ['test']", CqlAssembler::stringify(SubtractExpression::create(FieldExpression::create('testfield'), ListExpression::create('test'))));
 }