X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fpsy%2Fpsysh%2Ftest%2FPsy%2FTest%2FFormatter%2FSignatureFormatterTest.php;fp=vendor%2Fpsy%2Fpsysh%2Ftest%2FPsy%2FTest%2FFormatter%2FSignatureFormatterTest.php;h=0ceb5b477da9a1220baefff7b6510f8e58b1df47;hp=0000000000000000000000000000000000000000;hb=eba34333e3c89f208d2f72fa91351ad019a71583;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae diff --git a/vendor/psy/psysh/test/Psy/Test/Formatter/SignatureFormatterTest.php b/vendor/psy/psysh/test/Psy/Test/Formatter/SignatureFormatterTest.php new file mode 100644 index 000000000..0ceb5b477 --- /dev/null +++ b/vendor/psy/psysh/test/Psy/Test/Formatter/SignatureFormatterTest.php @@ -0,0 +1,77 @@ +assertEquals($expected, strip_tags(SignatureFormatter::format($reflector))); + } + + public function signatureReflectors() + { + return array( + array( + new \ReflectionClass($this), + "class Psy\Test\Formatter\SignatureFormatterTest " + . 'extends PHPUnit_Framework_TestCase implements ' + . 'Countable, PHPUnit_Framework_SelfDescribing, ' + . 'PHPUnit_Framework_Test', + ), + array( + new \ReflectionFunction('implode'), + defined('HHVM_VERSION') ? 'function implode($arg1, $arg2 = null)' : 'function implode($glue, $pieces)', + ), + array( + new ReflectionConstant($this, 'FOO'), + 'const FOO = "foo value"', + ), + array( + new \ReflectionMethod($this, 'someFakeMethod'), + 'private function someFakeMethod(array $one, $two = \'TWO\', Reflector $three = null)', + ), + array( + new \ReflectionProperty($this, 'bar'), + 'private static $bar', + ), + array( + new \ReflectionClass('Psy\CodeCleaner\CodeCleanerPass'), + 'abstract class Psy\CodeCleaner\CodeCleanerPass ' + . 'extends PhpParser\NodeVisitorAbstract ' + . 'implements PhpParser\NodeVisitor', + ), + ); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testSignatureFormatterThrowsUnknownReflectorExpeption() + { + $refl = $this->getMockBuilder('Reflector')->getMock(); + SignatureFormatter::format($refl); + } +}