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
![]() |
|||
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
|
|||
25 | static::assertFalse(true); |
||
26 | } |
||
27 | |||
28 | } |
||
29 | } |
||
30 |