|
@@ 128-140 (lines=13) @@
|
| 125 |
|
$dataQuery->execute(); |
| 126 |
|
} |
| 127 |
|
|
| 128 |
|
public function testDisjunctiveGroup() { |
| 129 |
|
$dq = new DataQuery('DataQueryTest_A'); |
| 130 |
|
|
| 131 |
|
$dq->where('DataQueryTest_A.ID = 2'); |
| 132 |
|
$subDq = $dq->disjunctiveGroup(); |
| 133 |
|
$subDq->where('DataQueryTest_A.Name = \'John\''); |
| 134 |
|
$subDq->where('DataQueryTest_A.Name = \'Bob\''); |
| 135 |
|
|
| 136 |
|
$this->assertSQLContains( |
| 137 |
|
"WHERE (DataQueryTest_A.ID = 2) AND ((DataQueryTest_A.Name = 'John') OR (DataQueryTest_A.Name = 'Bob'))", |
| 138 |
|
$dq->sql($parameters) |
| 139 |
|
); |
| 140 |
|
} |
| 141 |
|
|
| 142 |
|
public function testConjunctiveGroup() { |
| 143 |
|
$dq = new DataQuery('DataQueryTest_A'); |
|
@@ 142-154 (lines=13) @@
|
| 139 |
|
); |
| 140 |
|
} |
| 141 |
|
|
| 142 |
|
public function testConjunctiveGroup() { |
| 143 |
|
$dq = new DataQuery('DataQueryTest_A'); |
| 144 |
|
|
| 145 |
|
$dq->where('DataQueryTest_A.ID = 2'); |
| 146 |
|
$subDq = $dq->conjunctiveGroup(); |
| 147 |
|
$subDq->where('DataQueryTest_A.Name = \'John\''); |
| 148 |
|
$subDq->where('DataQueryTest_A.Name = \'Bob\''); |
| 149 |
|
|
| 150 |
|
$this->assertSQLContains( |
| 151 |
|
"WHERE (DataQueryTest_A.ID = 2) AND ((DataQueryTest_A.Name = 'John') AND (DataQueryTest_A.Name = 'Bob'))", |
| 152 |
|
$dq->sql($parameters) |
| 153 |
|
); |
| 154 |
|
} |
| 155 |
|
|
| 156 |
|
/** |
| 157 |
|
* @todo Test paramaterised |