* * @throws \InvalidArgumentException if $foo is empty * * @param mixed $foo It's a foo thing * @param int $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() { $escapedEmail = OutputFormatter::escape(''); $expected = <<Description: This is a docblock! Throws: \\InvalidArgumentException if \$foo is empty Param: mixed \$foo It's a foo thing int \$bar Return: string A string of no consequence Author: Justin Hileman $escapedEmail EOS; $this->assertSame( $expected, DocblockFormatter::format(new \ReflectionMethod($this, 'methodWithDocblock')) ); } }