);
}
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage Unexpected node of type "Stmt_Echo"
- */
public function testInvalidStmtError() {
+ $this->expectException(\LogicException::class);
+ $this->expectExceptionMessage('Unexpected node of type "Stmt_Echo"');
$this->createClassBuilder('Test')
->addStmt(new Stmt\Echo_([]))
;
}
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage Doc comment must be a string or an instance of PhpParser\Comment\Doc
- */
public function testInvalidDocComment() {
+ $this->expectException(\LogicException::class);
+ $this->expectExceptionMessage('Doc comment must be a string or an instance of PhpParser\Comment\Doc');
$this->createClassBuilder('Test')
->setDocComment(new Comment('Test'));
}
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage Name cannot be empty
- */
public function testEmptyName() {
+ $this->expectException(\LogicException::class);
+ $this->expectExceptionMessage('Name cannot be empty');
$this->createClassBuilder('Test')
->extend('');
}
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage Name must be a string or an instance of Node\Name
- */
public function testInvalidName() {
+ $this->expectException(\LogicException::class);
+ $this->expectExceptionMessage('Name must be a string or an instance of Node\Name');
$this->createClassBuilder('Test')
->extend(['Foo']);
}