public function testComment() {
$expected = array(
'description' => '',
'text' => null,
'tags' => array()
);
$result = Docblock::comment('');
$this->assertEqual($expected, $result);
$comment = "/**\n * Lithium is cool\n * @foo bar\n * @baz qux\n */";
$expected = array('description' => 'Lithium is cool', 'text' => '', 'tags' => array());
$result = Docblock::comment($comment);
$this->assertEqual($expected, $result);
Docblock::$tags[] = 'foo';
Docblock::$tags[] = 'baz';
$expected['tags'] = array('foo' => 'bar', 'baz' => 'qux');
$result = Docblock::comment($comment);
$this->assertEqual($expected, $result);
$comment = "/**\n * Lithium is cool\n *\n * Very cool\n * @foo bar\n * @baz qux\n */";
$expected = array(
'description' => 'Lithium is cool',
'text' => 'Very cool',
'tags' => array('foo' => 'bar', 'baz' => 'qux')
);
$result = Docblock::comment($comment);
$this->assertEqual($expected, $result);
}