diff vendor/nikic/php-parser/test/PhpParser/Node/NameTest.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
line wrap: on
line diff
--- a/vendor/nikic/php-parser/test/PhpParser/Node/NameTest.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/vendor/nikic/php-parser/test/PhpParser/Node/NameTest.php	Thu Feb 28 13:21:36 2019 +0000
@@ -2,9 +2,7 @@
 
 namespace PhpParser\Node;
 
-use PHPUnit\Framework\TestCase;
-
-class NameTest extends TestCase
+class NameTest extends \PHPUnit\Framework\TestCase
 {
     public function testConstruct() {
         $name = new Name(['foo', 'bar']);
@@ -51,35 +49,27 @@
         $this->assertNull($name->slice(-2, -2));
     }
 
-    /**
-     * @expectedException \OutOfBoundsException
-     * @expectedExceptionMessage Offset 4 is out of bounds
-     */
     public function testSliceOffsetTooLarge() {
+        $this->expectException(\OutOfBoundsException::class);
+        $this->expectExceptionMessage('Offset 4 is out of bounds');
         (new Name('foo\bar\baz'))->slice(4);
     }
 
-    /**
-     * @expectedException \OutOfBoundsException
-     * @expectedExceptionMessage Offset -4 is out of bounds
-     */
     public function testSliceOffsetTooSmall() {
+        $this->expectException(\OutOfBoundsException::class);
+        $this->expectExceptionMessage('Offset -4 is out of bounds');
         (new Name('foo\bar\baz'))->slice(-4);
     }
 
-    /**
-     * @expectedException \OutOfBoundsException
-     * @expectedExceptionMessage Length 4 is out of bounds
-     */
     public function testSliceLengthTooLarge() {
+        $this->expectException(\OutOfBoundsException::class);
+        $this->expectExceptionMessage('Length 4 is out of bounds');
         (new Name('foo\bar\baz'))->slice(0, 4);
     }
 
-    /**
-     * @expectedException \OutOfBoundsException
-     * @expectedExceptionMessage Length -4 is out of bounds
-     */
     public function testSliceLengthTooSmall() {
+        $this->expectException(\OutOfBoundsException::class);
+        $this->expectExceptionMessage('Length -4 is out of bounds');
         (new Name('foo\bar\baz'))->slice(0, -4);
     }
 
@@ -131,27 +121,21 @@
         $this->assertSame('namespace\foo', $name->toCodeString());
     }
 
-    /**
-     * @expectedException \InvalidArgumentException
-     * @expectedExceptionMessage Expected string, array of parts or Name instance
-     */
     public function testInvalidArg() {
+        $this->expectException(\InvalidArgumentException::class);
+        $this->expectExceptionMessage('Expected string, array of parts or Name instance');
         Name::concat('foo', new \stdClass);
     }
 
-    /**
-     * @expectedException \InvalidArgumentException
-     * @expectedExceptionMessage Name cannot be empty
-     */
     public function testInvalidEmptyString() {
+        $this->expectException(\InvalidArgumentException::class);
+        $this->expectExceptionMessage('Name cannot be empty');
         new Name('');
     }
 
-    /**
-     * @expectedException \InvalidArgumentException
-     * @expectedExceptionMessage Name cannot be empty
-     */
     public function testInvalidEmptyArray() {
+        $this->expectException(\InvalidArgumentException::class);
+        $this->expectExceptionMessage('Name cannot be empty');
         new Name([]);
     }