| Conditions | 1 |
| Paths | 1 |
| Total Lines | 32 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 42 | public function testUnion() |
||
| 43 | { |
||
| 44 | $posts = TableRegistry::getTableLocator()->get('Posts'); |
||
| 45 | |||
| 46 | $expected = ' |
||
| 47 | SELECT |
||
| 48 | * |
||
| 49 | FROM |
||
| 50 | ( |
||
| 51 | SELECT |
||
| 52 | Posts.* AS "Posts__*" |
||
| 53 | FROM |
||
| 54 | posts Posts |
||
| 55 | ORDER BY |
||
| 56 | modified ASC |
||
| 57 | ) |
||
| 58 | UNION ALL |
||
| 59 | SELECT |
||
| 60 | * |
||
| 61 | FROM |
||
| 62 | ( |
||
| 63 | DATETIME(\'now\') |
||
| 64 | ) |
||
| 65 | '; |
||
| 66 | |||
| 67 | $actual = $posts->find() |
||
| 68 | ->select(['*']) |
||
| 69 | ->orderAsc('modified') |
||
| 70 | ->unionAll($posts->query()->func()->now()) |
||
|
|
|||
| 71 | ->sql(); |
||
| 72 | |||
| 73 | $this->assertSqlEquals($expected, $actual); |
||
| 74 | } |
||
| 76 |