diff vendor/nikic/php-parser/test/PhpParser/PrettyPrinterTest.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents c2387f117808
children
line wrap: on
line diff
--- a/vendor/nikic/php-parser/test/PhpParser/PrettyPrinterTest.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/vendor/nikic/php-parser/test/PhpParser/PrettyPrinterTest.php	Thu Feb 28 13:21:36 2019 +0000
@@ -12,8 +12,6 @@
 use PhpParser\Node\Stmt;
 use PhpParser\PrettyPrinter\Standard;
 
-require_once __DIR__ . '/CodeTestAbstract.php';
-
 class PrettyPrinterTest extends CodeTestAbstract
 {
     protected function doTestPrettyPrintMethod($method, $name, $code, $expected, $modeLine) {
@@ -184,11 +182,9 @@
         ];
     }
 
-    /**
-     * @expectedException \LogicException
-     * @expectedExceptionMessage Cannot pretty-print AST with Error nodes
-     */
     public function testPrettyPrintWithError() {
+        $this->expectException(\LogicException::class);
+        $this->expectExceptionMessage('Cannot pretty-print AST with Error nodes');
         $stmts = [new Stmt\Expression(
             new Expr\PropertyFetch(new Expr\Variable('a'), new Expr\Error())
         )];
@@ -196,11 +192,9 @@
         $prettyPrinter->prettyPrint($stmts);
     }
 
-    /**
-     * @expectedException \LogicException
-     * @expectedExceptionMessage Cannot pretty-print AST with Error nodes
-     */
     public function testPrettyPrintWithErrorInClassConstFetch() {
+        $this->expectException(\LogicException::class);
+        $this->expectExceptionMessage('Cannot pretty-print AST with Error nodes');
         $stmts = [new Stmt\Expression(
             new Expr\ClassConstFetch(new Name('Foo'), new Expr\Error())
         )];
@@ -208,11 +202,9 @@
         $prettyPrinter->prettyPrint($stmts);
     }
 
-    /**
-     * @expectedException \LogicException
-     * @expectedExceptionMessage Cannot directly print EncapsedStringPart
-     */
     public function testPrettyPrintEncapsedStringPart() {
+        $this->expectException(\LogicException::class);
+        $this->expectExceptionMessage('Cannot directly print EncapsedStringPart');
         $expr = new Node\Scalar\EncapsedStringPart('foo');
         $prettyPrinter = new PrettyPrinter\Standard;
         $prettyPrinter->prettyPrintExpr($expr);