Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / nikic / php-parser / test / PhpParser / PrettyPrinterTest.php
index e47a9b9b3bf57e03c79d8e81ad48b1994f1630b3..d3c3f08a104228304b9ae48f1e32d145385bf5e9 100644 (file)
@@ -184,11 +184,9 @@ class PrettyPrinterTest extends CodeTestAbstract
         ];
     }
 
-    /**
-     * @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 +194,9 @@ class PrettyPrinterTest extends CodeTestAbstract
         $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,6 +204,14 @@ class PrettyPrinterTest extends CodeTestAbstract
         $prettyPrinter->prettyPrint($stmts);
     }
 
+    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);
+    }
+
     /**
      * @dataProvider provideTestFormatPreservingPrint
      * @covers \PhpParser\PrettyPrinter\Standard<extended>