ParamsInsideFunctionsTest::testFuncColumns()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 10
1
<?php
2
3
namespace Latitude\QueryBuilder\Issues;
4
5
use Latitude\QueryBuilder\TestCase;
6
7
use function Latitude\QueryBuilder\func;
8
use function Latitude\QueryBuilder\param;
9
10
/**
11
 * @link https://github.com/shadowhand/latitude/issues/57
12
 */
13
class ParamsInsideFunctionsTest extends TestCase
14
{
15
    public function testFuncColumns(): void
16
    {
17
        $expr = func('COUNT', 'id');
18
19
        $this->assertSql('COUNT(id)', $expr);
20
        $this->assertParams([], $expr);
21
22
    }
0 ignored issues
show
Coding Style introduced by Woody Gilk
Function closing brace must go on the next line following the body; found 1 blank lines before brace
Loading history...
23
24
    public function testFuncParams(): void
25
    {
26
        $expr = func('POINT', param(1), param(2));
27
28
        $this->assertSql('POINT(?, ?)', $expr);
29
        $this->assertParams([1, 2], $expr);
30
    }
31
}
32