Completed
Pull Request — master (#124)
by Enrico
04:10
created

UnsetCastTest::testUnsetCompile()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 0
dl 0
loc 11
rs 9.4285
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
        $this->assertInstanceOfCompiledExpression($compiledExpression);
22
        $this->assertSame(CompiledExpression::NULL, $compiledExpression->getType());
23
        $this->assertSame(null, $compiledExpression->getValue());
24
    }
25
}
26