ParamsInsideFunctionsTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 17
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testFuncColumns() 0 6 1
A testFuncParams() 0 6 1
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