Passed
Pull Request — master (#380)
by Wilmer
13:12
created

DefaultValueConstraintTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testGetValue() 0 13 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\Tests\Constraint;
6
7
use PHPUnit\Framework\TestCase;
8
use stdClass;
9
use Yiisoft\Db\Constraint\DefaultValueConstraint;
10
11
/**
12
 * @group db
13
 */
14
final class DefaultValueConstraintTest extends TestCase
15
{
16
    public function testGetValue(): void
17
    {
18
        $defaultValueConstraint = new DefaultValueConstraint();
19
20
        $this->assertNull($defaultValueConstraint->getValue());
21
22
        $defaultValueConstraint = $defaultValueConstraint->value('value');
23
24
        $this->assertSame('value', $defaultValueConstraint->getValue());
25
26
        $defaultValueConstraint = $defaultValueConstraint->value(new stdClass());
27
28
        $this->assertInstanceOf(stdClass::class, $defaultValueConstraint->getValue());
29
    }
30
}
31