|
1
|
|
|
<?php |
|
2
|
|
|
use PHPUnit\Framework\TestCase; |
|
|
|
|
|
|
3
|
|
|
use HexMakina\Crudites\Grammar\Clause\GroupBy; |
|
4
|
|
|
|
|
5
|
|
|
class GroupByTest extends TestCase |
|
6
|
|
|
{ |
|
7
|
|
|
public function testName() |
|
8
|
|
|
{ |
|
9
|
|
|
$selected = 'column1'; |
|
10
|
|
|
$groupBy = new GroupBy($selected); |
|
11
|
|
|
$this->assertEquals(GroupBy::GROUP, $groupBy->name()); |
|
12
|
|
|
} |
|
13
|
|
|
|
|
14
|
|
|
public function testConstructString() |
|
15
|
|
|
{ |
|
16
|
|
|
$selected = 'column1'; |
|
17
|
|
|
$groupBy = new GroupBy($selected); |
|
18
|
|
|
$this->assertEquals('GROUP BY column1', (string)$groupBy); |
|
19
|
|
|
} |
|
20
|
|
|
|
|
21
|
|
|
public function testConstructArray() |
|
22
|
|
|
{ |
|
23
|
|
|
$selected = ['table', 'column']; |
|
24
|
|
|
$groupBy = new GroupBy($selected); |
|
25
|
|
|
$this->assertEquals('GROUP BY `table`.`column`', (string)$groupBy); |
|
26
|
|
|
} |
|
27
|
|
|
|
|
28
|
|
|
public function testAddString() |
|
29
|
|
|
{ |
|
30
|
|
|
$selected = 'column1'; |
|
31
|
|
|
$groupBy = new GroupBy($selected); |
|
32
|
|
|
$groupBy->add('column2'); |
|
33
|
|
|
$this->assertEquals('GROUP BY column1,column2', (string)$groupBy); |
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
|
|
public function testAddArray() |
|
37
|
|
|
{ |
|
38
|
|
|
$selected = ['table', 'column']; |
|
39
|
|
|
$groupBy = new GroupBy($selected); |
|
40
|
|
|
$groupBy->add(['table', 'column2']); |
|
41
|
|
|
$this->assertEquals('GROUP BY `table`.`column`,`table`.`column2`', (string)$groupBy); |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
public function testStringAddArray() |
|
45
|
|
|
{ |
|
46
|
|
|
$selected = 'column'; |
|
47
|
|
|
$groupBy = new GroupBy($selected); |
|
48
|
|
|
$groupBy->add(['table', 'column2']); |
|
49
|
|
|
$this->assertEquals('GROUP BY column,`table`.`column2`', (string)$groupBy); |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
} |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths