Passed
Pull Request — master (#376)
by Wilmer
02:33
created

HashConditionTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

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

2 Methods

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