X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fpsy%2Fpsysh%2Ftest%2FPsy%2FTest%2FFormatter%2FDocblockFormatterTest.php;fp=vendor%2Fpsy%2Fpsysh%2Ftest%2FPsy%2FTest%2FFormatter%2FDocblockFormatterTest.php;h=3a736d7c6521dbf9f461c830d7f07114ca01c3bd;hp=0000000000000000000000000000000000000000;hb=eba34333e3c89f208d2f72fa91351ad019a71583;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae diff --git a/vendor/psy/psysh/test/Psy/Test/Formatter/DocblockFormatterTest.php b/vendor/psy/psysh/test/Psy/Test/Formatter/DocblockFormatterTest.php new file mode 100644 index 000000000..3a736d7c6 --- /dev/null +++ b/vendor/psy/psysh/test/Psy/Test/Formatter/DocblockFormatterTest.php @@ -0,0 +1,63 @@ + + * + * @throws InvalidArgumentException if $foo is empty + * + * @param mixed $foo It's a foo thing + * @param int $bar This is definitely bar + * + * @return string A string of no consequence + */ + private function methodWithDocblock($foo, $bar = 1) + { + if (empty($foo)) { + throw new \InvalidArgumentException(); + } + + return 'method called'; + } + + public function testFormat() + { + $expected = <<Description: + This is a docblock! + +Throws: + InvalidArgumentException if \$foo is empty + +Param: + mixed \$foo It's a foo thing + int \$bar This is definitely bar + +Return: + string A string of no consequence + +Author: Justin Hileman \ +EOS; + + $this->assertEquals( + $expected, + DocblockFormatter::format(new \ReflectionMethod($this, 'methodWithDocblock')) + ); + } +}