Passed
Pull Request — master (#380)
by Wilmer
02:51
created

ParamBuilderTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 9
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testBuild() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\Tests\Command;
6
7
use PHPUnit\Framework\TestCase;
8
use Yiisoft\Db\Command\ParamBuilder;
9
use Yiisoft\Db\Expression\Expression;
10
11
/**
12
 * @group db
13
 */
14
final class ParamBuilderTest extends TestCase
15
{
16
    public function testBuild(): void
17
    {
18
        $params = ['id' => 1, 'name' => 'test', 'expression' => new Expression('NOW()')];
19
        $expression = new Expression('id = :id AND name = :name AND expression = :expression', $params);
20
        $paramBuilder = new ParamBuilder();
21
22
        $this->assertSame(':pv3', $paramBuilder->build($expression, $params));
23
    }
24
}
25