| @@ 47-54 (lines=8) @@ | ||
| 44 | ); |
|
| 45 | } |
|
| 46 | ||
| 47 | public function testSimpleSelectDistinct() |
|
| 48 | { |
|
| 49 | $this->selectQuery->cols('id, name')->options('distinct')->from('table x')->where('id = 5'); |
|
| 50 | static::assertEquals( |
|
| 51 | "SELECT DISTINCT id, name FROM table x WHERE id = 5", |
|
| 52 | $this->selectQuery->assemble() |
|
| 53 | ); |
|
| 54 | } |
|
| 55 | ||
| 56 | public function testWhereAndWhere() |
|
| 57 | { |
|
| @@ 56-64 (lines=9) @@ | ||
| 53 | ); |
|
| 54 | } |
|
| 55 | ||
| 56 | public function testWhereAndWhere() |
|
| 57 | { |
|
| 58 | $this->selectQuery->cols('id, name')->from('table x'); |
|
| 59 | $this->selectQuery->where('id = 5')->where("active = 'yes'"); |
|
| 60 | static::assertEquals( |
|
| 61 | "SELECT id, name FROM table x WHERE id = 5 AND active = 'yes'", |
|
| 62 | $this->selectQuery->assemble() |
|
| 63 | ); |
|
| 64 | } |
|
| 65 | ||
| 66 | public function testWhereOrWhere() |
|
| 67 | { |
|
| @@ 66-74 (lines=9) @@ | ||
| 63 | ); |
|
| 64 | } |
|
| 65 | ||
| 66 | public function testWhereOrWhere() |
|
| 67 | { |
|
| 68 | $this->selectQuery->cols('id, name')->from('table x'); |
|
| 69 | $this->selectQuery->where('id = 5')->orWhere('id = 7'); |
|
| 70 | static::assertEquals( |
|
| 71 | "SELECT id, name FROM table x WHERE id = 5 OR id = 7", |
|
| 72 | $this->selectQuery->assemble() |
|
| 73 | ); |
|
| 74 | } |
|
| 75 | ||
| 76 | public function testInitializeCondition() |
|
| 77 | { |
|