comparison vendor/nikic/php-parser/test/PhpParser/Builder/InterfaceTest.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 5fb285c0d0e3
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
4 4
5 use PhpParser\Comment; 5 use PhpParser\Comment;
6 use PhpParser\Node; 6 use PhpParser\Node;
7 use PhpParser\Node\Scalar\DNumber; 7 use PhpParser\Node\Scalar\DNumber;
8 use PhpParser\Node\Stmt; 8 use PhpParser\Node\Stmt;
9 use PHPUnit\Framework\TestCase;
10 9
11 class InterfaceTest extends TestCase 10 class InterfaceTest extends \PHPUnit\Framework\TestCase
12 { 11 {
13 /** @var Interface_ */ 12 /** @var Interface_ */
14 protected $builder; 13 protected $builder;
15 14
16 protected function setUp() { 15 protected function setUp() {
77 $this->assertEquals(new Stmt\Interface_('Contract', [], [ 76 $this->assertEquals(new Stmt\Interface_('Contract', [], [
78 'comments' => [new Comment\Doc('/** Test */')] 77 'comments' => [new Comment\Doc('/** Test */')]
79 ]), $node); 78 ]), $node);
80 } 79 }
81 80
82 /**
83 * @expectedException \LogicException
84 * @expectedExceptionMessage Unexpected node of type "Stmt_PropertyProperty"
85 */
86 public function testInvalidStmtError() { 81 public function testInvalidStmtError() {
82 $this->expectException(\LogicException::class);
83 $this->expectExceptionMessage('Unexpected node of type "Stmt_PropertyProperty"');
87 $this->builder->addStmt(new Stmt\PropertyProperty('invalid')); 84 $this->builder->addStmt(new Stmt\PropertyProperty('invalid'));
88 } 85 }
89 86
90 public function testFullFunctional() { 87 public function testFullFunctional() {
91 $const = new Stmt\ClassConst([ 88 $const = new Stmt\ClassConst([