Completed
Pull Request — master (#271)
by Enrico
10:20
created

ObjectCastTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testUnexpectedType() 0 11 1
A objectCastDataProvider() 0 4 1
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 ObjectCastTest extends \Tests\PHPSA\TestCase
10
{
11
    /**
12
     * Tests (object) {expr} = {expr}
13
     */
14
    public function objectCastDataProvider()
15
    {
16
        // @todo implement
17
    }
18
19
    public function testUnexpectedType()
20
    {
21
        $baseExpression = new Node\Expr\Cast\Object_(
22
            $this->newFakeScalarExpr()
23
        );
24
        $compiledExpression = $this->compileExpression($baseExpression);
25
26
        $this->assertInstanceOfCompiledExpression($compiledExpression);
27
        $this->assertSame(CompiledExpression::UNKNOWN, $compiledExpression->getType());
28
        $this->assertSame(null, $compiledExpression->getValue());
29
    }
30
}
31