public function testPassUnexpectedExpression() { $expr = new UnaryMinus(); $this->assertSame('PhpParser\\Node\\Expr\\UnaryMinus', $expr->getName()); $this->setExpectedException('InvalidArgumentException', 'Passed $expression must be instance of PhpParser\\Node\\Expr\\UnaryMinus'); $expr->pass($this->newFakeScalarExpr(), $this->getContext()); }
/** * @expectedException \InvalidArgumentException * @expectedExceptionMessage Passed $expression must be instance of PhpParser\Node\Expr\UnaryMinus */ public function testPassUnexpectedExpression() { $expr = new UnaryMinus(); self::assertSame('PhpParser\\Node\\Expr\\UnaryMinus', $expr->getName()); $expr->pass($this->newFakeScalarExpr(), $this->getContext()); }