Passed
Push — 7.x ( 3ebc9f...4982c4 )
by Adrien
08:52
created

SplBoolUnstrictTest::test()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 6
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 11
rs 10
1
<?php
2
3
/**
4
 * Part of SplTypes package.
5
 *
6
 * (c) Adrien Loyant <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=0);
13
14
namespace Ducks\Component\SplTypes\Tests\phpunit;
15
16
use Ducks\Component\SplTypes\SplBool as DuckBool;
17
use PHPUnit\Framework\TestCase;
18
19
class SplBoolUnstrictTest extends TestCase
20
{
21
    /**
22
     * Unit test.
23
     *
24
     * @return void
25
     *
26
     * @psalm-suppress InvalidScalarArgument
27
     */
28
    public function test(): void
29
    {
30
        // @phpstan-ignore-next-line
31
        $instance = new DuckBool(0);
32
        $this->assertFalse($instance());
33
        unset($instance);
34
35
        // @phpstan-ignore-next-line
36
        $instance = new DuckBool(1);
37
        $this->assertTrue($instance());
38
        unset($instance);
39
    }
40
}
41