Beispiel #1
0
 public function testBasic()
 {
     $table = new Sql\Table("my_table", "t");
     $table->leftJoin("other_table", "x", "t.id = x.id AND y = ?", [4711]);
     $table->leftJoin("third_table", "y", Op::bin(new Id("t.id"), '=', new Id("y.id")));
     $res = $table->render($this->board(false));
     //        $this->dump($res, 0);
     //        var_dump($res->getParams());
 }
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());
 }