Issues (6)

tests/Issues/ParamsInsideFunctionsTest.php (1 issue)

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
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