Completed
Pull Request — master (#124)
by Enrico
04:01 queued 01:12
created

ExpressionCompilerTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testPassUnexpectedExpression() 0 7 1
1
<?php
2
3
namespace Tests\PHPSA\Compiler\Expression;
4
5
use PhpParser\Node;
6
use PHPSA\CompiledExpression;
7
use PHPSA\Compiler\Expression;
8
use PHPSA\Compiler\Expression\Operators\UnaryMinus;
9
10
/**
11
 * Class ExpressionCompilerTest
12
 * @package Tests\PHPSA\Expression\BinaryOp
13
 */
14
class ExpressionCompilerTest extends \Tests\PHPSA\TestCase
15
{
16
    /**
17
     * @expectedException \InvalidArgumentException
18
     * @expectedExceptionMessage Passed $expression must be instance of PhpParser\Node\Expr\UnaryMinus
19
     */
20
    public function testPassUnexpectedExpression()
21
    {
22
        $expr = new UnaryMinus();
23
        self::assertSame('PhpParser\Node\Expr\UnaryMinus', $expr->getName());
24
25
        $expr->pass($this->newFakeScalarExpr(), $this->getContext());
26
    }
27
}
28