Passed
Push — master ( 763c33...debe09 )
by Wilmer
29:07 queued 26:37
created

HashConditionTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testConstructor() 0 5 1
A testFromArrayDefinition() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\Tests\QueryBuilder\Condition;
6
7
use PHPUnit\Framework\TestCase;
8
use Yiisoft\Db\QueryBuilder\Conditions\HashCondition;
9
10
/**
11
 * @group db
12
 */
13
final class HashConditionTest extends TestCase
14
{
15
    public function testConstructor(): void
16
    {
17
        $hashCondition = new HashCondition(['expired' => false, 'active' => true]);
18
19
        $this->assertSame(['expired' => false, 'active' => true], $hashCondition->getHash());
20
    }
21
22
    public function testFromArrayDefinition(): void
23
    {
24
        $hashCondition = HashCondition::fromArrayDefinition('AND', ['expired' => false, 'active' => true]);
25
26
        $this->assertSame(['expired' => false, 'active' => true], $hashCondition->getHash());
27
    }
28
}
29