39 public function testMakeQuery()
44 $selectQueryAdapter->addClause(
'a',
'b',
'c');
47 makeQuery(
'myTable', $selectQueryAdapter, $joinTablesAdapter, 2, 4,
'a = x',
'something asc');
48 $compareSql =
"select {$quote}a{$quote}.{$quote}b{$quote} c ";
49 $compareSql .=
"from {$quote}myTable{$quote} ";
50 $compareSql .=
"where a = x ";
51 $compareSql .=
"order by something asc ";
52 $compareSql .=
'limit 4 offset 2';
53 $this->assertEquals($compareSql, $sql);
56 public function testMakeQueryWithGroupBy()
61 $selectQueryAdapter->addClause(
'a',
'b',
'c');
64 makeQuery(
'myTable', $selectQueryAdapter, $joinTablesAdapter, 2, 4,
'a = x', null,
'a.group');
65 $compareSql =
"select {$quote}a{$quote}.{$quote}b{$quote} c ";
66 $compareSql .=
"from {$quote}myTable{$quote} ";
67 $compareSql .=
"where a = x ";
68 $compareSql .=
"group by a.group ";
69 $compareSql .=
'limit 4 offset 2';
70 $this->assertEquals($compareSql, $sql);