| Conditions | 1 |
| Paths | 1 |
| Total Lines | 21 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | public function testDoStatementCreatesVar() |
||
| 37 | { |
||
| 38 | $context = $this->getContext(); |
||
| 39 | |||
| 40 | $statement = new Node\Stmt\Do_( |
||
| 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 | \PHPSA\nodeVisitorFactory($statement, $context); |
||
| 52 | |||
| 53 | $variable = $context->getSymbol("stmtTest"); |
||
| 54 | |||
| 55 | parent::assertTrue($variable instanceof Variable); |
||
| 56 | } |
||
| 57 | } |
||
| 58 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()method in theSoncalls the wrong method in the parent class.