Beispiel #1
0
 public function testBlock4()
 {
     $alias = new Alias($sum = new Op('+', ["red", "yellow", "green"]), "local");
     $node = Enum::values(["aa", "bb", $alias, "cc"]);
     $sum->setBlock();
     $res = $node->render($this->board(), 1);
     $exp = implode("\n", ["  'aa',", "  'bb',", "      red", "      + yellow", "      + green AS \"local\",", "  'cc'"]);
     // $this->dump($res, 1);
     // $this->assertEquals($exp, $res->getSql());
 }
Beispiel #2
0
 public function testBlock5()
 {
     $board = $this->board();
     $cc = Op::bin('xx', '@@', 'yy');
     $node = new Op('AND', ['aa', Op::bin('bb', 'OR', $cc), 'dd']);
     $node->setBlock();
     $res = $node->render($board, 1);
     $exp = implode("\n", ["  aa", "  AND (bb OR (xx @@ yy))", "  AND dd"]);
     // $this->dump($res, 0);
     $this->assertEquals($exp, $res->getSql());
 }