Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / nikic / php-parser / test / PhpParser / Node / NameTest.php
index 8fe9ed63e0c37f6cfe10984c03e6445bd82b1dac..bf7d79670e02eb1c1807ac35a6fb00b2262186d5 100644 (file)
@@ -51,35 +51,27 @@ class NameTest extends TestCase
         $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 +123,21 @@ class NameTest extends TestCase
         $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([]);
     }