Passed
Pull Request — master (#395)
by Wilmer
04:09 queued 01:23
created

IndexConstraintTest::testIsPrimary()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 9
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\Tests\Constraint;
6
7
use PHPUnit\Framework\TestCase;
8
use Yiisoft\Db\Constraint\IndexConstraint;
9
10
/**
11
 * @group db
12
 */
13
final class IndexConstraintTest extends TestCase
14
{
15
    public function testIsUnique(): void
16
    {
17
        $indexConstraint = new IndexConstraint();
18
19
        $this->assertFalse($indexConstraint->isUnique());
20
21
        $indexConstraint = $indexConstraint->unique(true);
22
23
        $this->assertTrue($indexConstraint->isUnique());
24
    }
25
26
    public function testIsPrimary(): void
27
    {
28
        $indexConstraint = new IndexConstraint();
29
30
        $this->assertFalse($indexConstraint->isPrimary());
31
32
        $indexConstraint = $indexConstraint->primary(true);
33
34
        $this->assertTrue($indexConstraint->isPrimary());
35
    }
36
}
37