| Conditions | 1 |
| Paths | 1 |
| Total Lines | 35 |
| Code Lines | 32 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function testAnalyzeOrderBy(): void |
||
| 14 | { |
||
| 15 | $analyzer = new OrderByAnalyzer(new VoidCache(), ''); |
||
|
|
|||
| 16 | $results = $analyzer->analyzeOrderBy('`a`, b desc, rand() DESC, masc, mytable.mycol'); |
||
| 17 | |||
| 18 | $this->assertCount(5, $results); |
||
| 19 | $this->assertEquals([ |
||
| 20 | 'type' => 'colref', |
||
| 21 | 'table' => null, |
||
| 22 | 'column' => 'a', |
||
| 23 | 'direction' => 'ASC', |
||
| 24 | ], $results[0]); |
||
| 25 | $this->assertEquals([ |
||
| 26 | 'type' => 'colref', |
||
| 27 | 'table' => null, |
||
| 28 | 'column' => 'b', |
||
| 29 | 'direction' => 'DESC', |
||
| 30 | ], $results[1]); |
||
| 31 | $this->assertEquals([ |
||
| 32 | 'type' => 'expr', |
||
| 33 | 'expr' => 'rand()', |
||
| 34 | 'direction' => 'DESC', |
||
| 35 | ], $results[2]); |
||
| 36 | $this->assertEquals([ |
||
| 37 | 'type' => 'colref', |
||
| 38 | 'table' => null, |
||
| 39 | 'column' => 'masc', |
||
| 40 | 'direction' => 'ASC', |
||
| 41 | ], $results[3]); |
||
| 42 | $this->assertEquals([ |
||
| 43 | 'type' => 'colref', |
||
| 44 | 'table' => 'mytable', |
||
| 45 | 'column' => 'mycol', |
||
| 46 | 'direction' => 'ASC', |
||
| 47 | ], $results[4]); |
||
| 48 | } |
||
| 72 |