Conditions | 1 |
Paths | 1 |
Total Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
13 | public function testIfElseCreatesVar() |
||
14 | { |
||
15 | $context = $this->getContext(); |
||
16 | |||
17 | $statement = new Node\Stmt\If_( |
||
18 | new Node\Expr\BinaryOp\Equal($this->newScalarExpr(1), $this->newScalarExpr(2)), |
||
19 | ["else" => |
||
20 | new Node\Stmt\Else_( |
||
21 | [new Node\Expr\Assign( |
||
22 | new Node\Expr\Variable( |
||
23 | new Node\Name("stmtTest") |
||
24 | ), |
||
25 | $this->newScalarExpr(2) |
||
26 | )] |
||
27 | ) |
||
28 | ] |
||
29 | ); |
||
30 | |||
31 | \PHPSA\nodeVisitorFactory($statement, $context); |
||
32 | |||
33 | $variable = $context->getSymbol("stmtTest"); |
||
34 | |||
35 | self::assertTrue($variable instanceof Variable); |
||
36 | } |
||
37 | } |
||
38 |