Total Complexity | 3 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
6 | class OrderByTest extends TestCase |
||
7 | { |
||
8 | public function testConstruct() |
||
9 | { |
||
10 | $selected = 'column1'; |
||
11 | $direction = 'ASC'; |
||
12 | $orderBy = new OrderBy($selected, $direction); |
||
13 | |||
14 | $this->assertInstanceOf(OrderBy::class, $orderBy); |
||
15 | $this->assertEquals('ORDER BY column1 ASC', (string)$orderBy); |
||
16 | } |
||
17 | |||
18 | public function testAdd() |
||
19 | { |
||
20 | $selected1 = 'column1'; |
||
21 | $direction1 = 'ASC'; |
||
22 | $orderBy = new OrderBy($selected1, $direction1); |
||
23 | |||
24 | $selected2 = 'column2'; |
||
25 | $direction2 = 'DESC'; |
||
26 | $orderBy->add($selected2, $direction2); |
||
27 | |||
28 | $this->assertEquals('ORDER BY column1 ASC,column2 DESC', (string)$orderBy); |
||
29 | } |
||
30 | |||
31 | public function testName() |
||
35 | } |
||
36 | } |