* * @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->assertSame( $expected, DocblockFormatter::format(new \ReflectionMethod($this, 'methodWithDocblock')) ); } }