BooleanTest::testToNative()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 1
b 0
f 0
1
<?php declare(strict_types=1);
2
/**
3
 * This file is part of the daikon-cqrs/value-object project.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace Daikon\Tests\ValueObject;
10
11
use Daikon\ValueObject\BoolValue;
12
use PHPUnit\Framework\TestCase;
13
14
final class BooleanTest extends TestCase
15
{
16 1
    public function testToNative(): void
17
    {
18 1
        $this->assertTrue(BoolValue::fromNative(true)->toNative());
19 1
        $this->assertFalse(BoolValue::fromNative(false)->toNative());
20 1
    }
21
22 1
    public function testEquals(): void
23
    {
24 1
        $bool = BoolValue::fromNative(true);
25 1
        $this->assertTrue($bool->equals(BoolValue::fromNative(true)));
26 1
        $this->assertFalse($bool->equals(BoolValue::fromNative(false)));
27 1
    }
28
29 1
    public function testIsTrue(): void
30
    {
31 1
        $this->assertTrue(BoolValue::fromNative(true)->isTrue());
32 1
    }
33
34 1
    public function testIsFalse(): void
35
    {
36 1
        $this->assertTrue(BoolValue::fromNative(false)->isFalse());
37 1
    }
38
39 1
    public function testNegate(): void
40
    {
41 1
        $this->assertTrue(BoolValue::fromNative(false)->negate()->toNative());
42 1
    }
43
44 1
    public function testToString(): void
45
    {
46 1
        $this->assertEquals('true', (string)BoolValue::fromNative(true));
47 1
        $this->assertEquals('false', (string)BoolValue::fromNative(false));
48 1
    }
49
}
50