Mercurial > hg > isophonics-drupal-site
comparison vendor/psy/psysh/test/Formatter/SignatureFormatterTest.php @ 16:c2387f117808
Routine composer update
author | Chris Cannam |
---|---|
date | Tue, 10 Jul 2018 15:07:59 +0100 |
parents | 5fb285c0d0e3 |
children | 129ea1e6d783 |
comparison
equal
deleted
inserted
replaced
15:e200cb7efeb3 | 16:c2387f117808 |
---|---|
10 */ | 10 */ |
11 | 11 |
12 namespace Psy\Test\Formatter; | 12 namespace Psy\Test\Formatter; |
13 | 13 |
14 use Psy\Formatter\SignatureFormatter; | 14 use Psy\Formatter\SignatureFormatter; |
15 use Psy\Reflection\ReflectionConstant; | 15 use Psy\Reflection\ReflectionClassConstant; |
16 use Psy\Reflection\ReflectionConstant_; | |
16 | 17 |
17 class SignatureFormatterTest extends \PHPUnit\Framework\TestCase | 18 class SignatureFormatterTest extends \PHPUnit\Framework\TestCase |
18 { | 19 { |
19 const FOO = 'foo value'; | 20 const FOO = 'foo value'; |
20 private static $bar = 'bar value'; | 21 private static $bar = 'bar value'; |
37 [ | 38 [ |
38 new \ReflectionFunction('implode'), | 39 new \ReflectionFunction('implode'), |
39 defined('HHVM_VERSION') ? 'function implode($arg1, $arg2 = null)' : 'function implode($glue, $pieces)', | 40 defined('HHVM_VERSION') ? 'function implode($arg1, $arg2 = null)' : 'function implode($glue, $pieces)', |
40 ], | 41 ], |
41 [ | 42 [ |
42 new ReflectionConstant($this, 'FOO'), | 43 ReflectionClassConstant::create($this, 'FOO'), |
43 'const FOO = "foo value"', | 44 'const FOO = "foo value"', |
44 ], | 45 ], |
45 [ | 46 [ |
46 new \ReflectionMethod($this, 'someFakeMethod'), | 47 new \ReflectionMethod($this, 'someFakeMethod'), |
47 'private function someFakeMethod(array $one, $two = \'TWO\', Reflector $three = null)', | 48 'private function someFakeMethod(array $one, $two = \'TWO\', Reflector $three = null)', |
54 new \ReflectionClass('Psy\CodeCleaner\CodeCleanerPass'), | 55 new \ReflectionClass('Psy\CodeCleaner\CodeCleanerPass'), |
55 'abstract class Psy\CodeCleaner\CodeCleanerPass ' | 56 'abstract class Psy\CodeCleaner\CodeCleanerPass ' |
56 . 'extends PhpParser\NodeVisitorAbstract ' | 57 . 'extends PhpParser\NodeVisitorAbstract ' |
57 . 'implements PhpParser\NodeVisitor', | 58 . 'implements PhpParser\NodeVisitor', |
58 ], | 59 ], |
60 [ | |
61 new \ReflectionFunction('array_chunk'), | |
62 'function array_chunk($arg, $size, $preserve_keys = unknown)', | |
63 ], | |
64 [ | |
65 new \ReflectionClass('Psy\Test\Formatter\Fixtures\BoringTrait'), | |
66 'trait Psy\Test\Formatter\Fixtures\BoringTrait', | |
67 ], | |
68 [ | |
69 new \ReflectionMethod('Psy\Test\Formatter\Fixtures\BoringTrait', 'boringMethod'), | |
70 'public function boringMethod($one = 1)', | |
71 ], | |
72 [ | |
73 new ReflectionConstant_('E_ERROR'), | |
74 'define("E_ERROR", 1)', | |
75 ], | |
76 [ | |
77 new ReflectionConstant_('PHP_VERSION'), | |
78 'define("PHP_VERSION", "' . PHP_VERSION . '")', | |
79 ], | |
80 [ | |
81 new ReflectionConstant_('__LINE__'), | |
82 'define("__LINE__", null)', // @todo show this as `unknown` in red or something? | |
83 ], | |
59 ]; | 84 ]; |
60 } | 85 } |
61 | 86 |
62 /** | 87 /** |
63 * @expectedException \InvalidArgumentException | 88 * @expectedException \InvalidArgumentException |