| Total Complexity | 3 |
| Total Lines | 65 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 9 | class SqliteCompilerTest extends TestCase |
||
| 10 | { |
||
| 11 | public $fixtures = [ |
||
| 12 | 'plugin.Lampager\\Cake.Posts', |
||
| 13 | ]; |
||
| 14 | |||
| 15 | public function setUp() |
||
| 16 | { |
||
| 17 | $config = ConnectionManager::getConfig('test'); |
||
| 18 | $this->skipIf(strpos($config['driver'], 'Sqlite') === false, 'Not using Sqlite'); |
||
| 19 | } |
||
| 20 | |||
| 21 | public function testSelect() |
||
| 22 | { |
||
| 23 | $posts = TableRegistry::getTableLocator()->get('Posts'); |
||
| 24 | |||
| 25 | $expected = ' |
||
| 26 | SELECT |
||
| 27 | Posts.* AS "Posts__*" |
||
| 28 | FROM |
||
| 29 | posts Posts |
||
| 30 | ORDER BY |
||
| 31 | modified ASC |
||
| 32 | '; |
||
| 33 | |||
| 34 | $actual = $posts->find() |
||
| 35 | ->select(['*']) |
||
| 36 | ->orderAsc('modified') |
||
| 37 | ->sql(); |
||
| 38 | |||
| 39 | $this->assertSqlEquals($expected, $actual); |
||
| 40 | } |
||
| 41 | |||
| 42 | public function testUnion() |
||
| 74 | } |
||
| 75 | } |
||
| 76 |