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
{
*/
public function testFormat($reflector, $expected)
{
- $this->assertSame($expected, strip_tags(SignatureFormatter::format($reflector)));
+ $this->assertSame($expected, \strip_tags(SignatureFormatter::format($reflector)));
}
public function signatureReflectors()
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"',
],
[
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?
+ ],
];
}