| Conditions | 1 |
| Paths | 1 |
| Total Lines | 24 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | public function testBuilder() |
||
| 15 | { |
||
| 16 | $stmt = new SelectStatement(); |
||
| 17 | |||
| 18 | $stmt->options = new OptionsArray(array('DISTINCT')); |
||
| 19 | |||
| 20 | $stmt->expr[] = new Expression('sakila', 'film', 'film_id', 'fid'); |
||
| 21 | $stmt->expr[] = new Expression('COUNT(film_id)'); |
||
| 22 | |||
| 23 | $stmt->from[] = new Expression('', 'film', ''); |
||
| 24 | $stmt->from[] = new Expression('', 'actor', ''); |
||
| 25 | |||
| 26 | $stmt->where[] = new Condition('film_id > 10'); |
||
| 27 | $stmt->where[] = new Condition('OR'); |
||
| 28 | $stmt->where[] = new Condition('actor.age > 25'); |
||
| 29 | |||
| 30 | $stmt->limit = new Limit(1, 10); |
||
| 31 | |||
| 32 | $this->assertEquals( |
||
| 33 | 'SELECT DISTINCT `sakila`.`film`.`film_id` AS `fid`, COUNT(film_id) ' . |
||
| 34 | 'FROM `film`, `actor` ' . |
||
| 35 | 'WHERE film_id > 10 OR actor.age > 25 ' . |
||
| 36 | 'LIMIT 10, 1', |
||
| 37 | (string) $stmt |
||
| 38 | ); |
||
| 41 |