TruthyTest::test_truthy()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 8
c 1
b 0
f 0
nc 4
nop 0
dl 0
loc 12
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ByTIC\DataObjects\Tests;
6
7
use ByTIC\DataObjects\Truthy;
8
9
/**
10
 *
11
 */
12
class TruthyTest extends AbstractTest
13
{
14
    public function test_truthy()
15
    {
16
        $true = new Truthy('<true>1</true>'); // XML with content eval's to TRUE
17
        static::assertTrue((bool)$true);
18
        if ($true == false) {
0 ignored issues
show
introduced by
The condition $true == false is always false.
Loading history...
19
            static::assertFalse(true);
20
        }
21
22
        $false = new Truthy('<false></false>'); // empty XML eval's to FALSE
23
        static::assertFalse((boolean)$false);
24
        if ($false == true) {
0 ignored issues
show
introduced by
The condition $false == true is always true.
Loading history...
25
            static::assertFalse(true);
26
        }
27
28
    }
29
}
30