Mercurial > hg > isophonics-drupal-site
comparison vendor/nikic/php-parser/test/PhpParser/Builder/TraitTest.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 |
---|---|
3 namespace PhpParser\Builder; | 3 namespace PhpParser\Builder; |
4 | 4 |
5 use PhpParser\Comment; | 5 use PhpParser\Comment; |
6 use PhpParser\Node\Name; | 6 use PhpParser\Node\Name; |
7 use PhpParser\Node\Stmt; | 7 use PhpParser\Node\Stmt; |
8 use PHPUnit\Framework\TestCase; | |
9 | 8 |
10 class TraitTest extends TestCase | 9 class TraitTest extends \PHPUnit\Framework\TestCase |
11 { | 10 { |
12 protected function createTraitBuilder($class) { | 11 protected function createTraitBuilder($class) { |
13 return new Trait_($class); | 12 return new Trait_($class); |
14 } | 13 } |
15 | 14 |
35 new Comment\Doc('/** Nice trait */') | 34 new Comment\Doc('/** Nice trait */') |
36 ] | 35 ] |
37 ]), $trait); | 36 ]), $trait); |
38 } | 37 } |
39 | 38 |
40 /** | |
41 * @expectedException \LogicException | |
42 * @expectedExceptionMessage Unexpected node of type "Stmt_Echo" | |
43 */ | |
44 public function testInvalidStmtError() { | 39 public function testInvalidStmtError() { |
40 $this->expectException(\LogicException::class); | |
41 $this->expectExceptionMessage('Unexpected node of type "Stmt_Echo"'); | |
45 $this->createTraitBuilder('Test') | 42 $this->createTraitBuilder('Test') |
46 ->addStmt(new Stmt\Echo_([])) | 43 ->addStmt(new Stmt\Echo_([])) |
47 ; | 44 ; |
48 } | 45 } |
49 } | 46 } |