UnsetCastTest::testUnsetCompile()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
1
<?php
2
3
namespace Tests\PHPSA\Compiler\Expression\Casts;
4
5
use PhpParser\Node;
6
use PHPSA\CompiledExpression;
7
use PHPSA\Compiler\Expression;
8
9
class UnsetCastTest extends \Tests\PHPSA\TestCase
10
{
11
    /**
12
     * Tests (unset) {expr} = null
13
     */
14
    public function testUnsetCompile()
15
    {
16
        $baseExpression = new Node\Expr\Cast\Unset_(
17
            $this->newScalarExpr(1)
18
        );
19
        $compiledExpression = $this->compileExpression($baseExpression);
20
21
        self::assertInstanceOfCompiledExpression($compiledExpression);
22
        self::assertSame(CompiledExpression::NULL, $compiledExpression->getType());
23
        self::assertSame(null, $compiledExpression->getValue());
24
    }
25
}
26