| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | public function testIfStatementCreatesVar() |
||
| 37 | { |
||
| 38 | $context = $this->getContext(); |
||
| 39 | |||
| 40 | $statement = new Node\Stmt\If_( |
||
| 41 | new Node\Expr\BinaryOp\Equal($this->newScalarExpr(1), $this->newScalarExpr(1)), |
||
| 42 | ["stmts" => |
||
| 43 | [new Node\Expr\Assign( |
||
| 44 | new Node\Expr\Variable( |
||
| 45 | new Node\Name("stmtTest") |
||
| 46 | ), |
||
| 47 | $this->newScalarExpr(2) |
||
| 48 | )] |
||
| 49 | ] |
||
| 50 | ); |
||
| 51 | |||
| 52 | \PHPSA\nodeVisitorFactory($statement, $context); |
||
| 53 | |||
| 54 | $variable = $context->getSymbol("stmtTest"); |
||
| 55 | |||
| 56 | self::assertTrue($variable instanceof Variable); |
||
| 57 | } |
||
| 58 | } |
||
| 59 |