Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / psy / psysh / test / Formatter / SignatureFormatterTest.php
index 42361792068a6166c51ab1911bda5bd575e6dfd4..096e6ae786bf071028ce19327af234851c553d47 100644 (file)
@@ -12,7 +12,8 @@
 namespace Psy\Test\Formatter;
 
 use Psy\Formatter\SignatureFormatter;
-use Psy\Reflection\ReflectionConstant;
+use Psy\Reflection\ReflectionClassConstant;
+use Psy\Reflection\ReflectionConstant_;
 
 class SignatureFormatterTest extends \PHPUnit\Framework\TestCase
 {
@@ -28,7 +29,7 @@ class SignatureFormatterTest extends \PHPUnit\Framework\TestCase
      */
     public function testFormat($reflector, $expected)
     {
-        $this->assertSame($expected, strip_tags(SignatureFormatter::format($reflector)));
+        $this->assertSame($expected, \strip_tags(SignatureFormatter::format($reflector)));
     }
 
     public function signatureReflectors()
@@ -36,10 +37,10 @@ class SignatureFormatterTest extends \PHPUnit\Framework\TestCase
         return [
             [
                 new \ReflectionFunction('implode'),
-                defined('HHVM_VERSION') ? 'function implode($arg1, $arg2 = null)' : 'function implode($glue, $pieces)',
+                \defined('HHVM_VERSION') ? 'function implode($arg1, $arg2 = null)' : 'function implode($glue, $pieces)',
             ],
             [
-                new ReflectionConstant($this, 'FOO'),
+                ReflectionClassConstant::create($this, 'FOO'),
                 'const FOO = "foo value"',
             ],
             [
@@ -68,6 +69,18 @@ class SignatureFormatterTest extends \PHPUnit\Framework\TestCase
                 new \ReflectionMethod('Psy\Test\Formatter\Fixtures\BoringTrait', 'boringMethod'),
                 'public function boringMethod($one = 1)',
             ],
+            [
+                new ReflectionConstant_('E_ERROR'),
+                'define("E_ERROR", 1)',
+            ],
+            [
+                new ReflectionConstant_('PHP_VERSION'),
+                'define("PHP_VERSION", "' . PHP_VERSION . '")',
+            ],
+            [
+                new ReflectionConstant_('__LINE__'),
+                'define("__LINE__", null)', // @todo show this as `unknown` in red or something?
+            ],
         ];
     }