mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
Made PSR2 related fixes that are compatible with the PEAR coding standard.
This commit is contained in:
@@ -38,7 +38,12 @@ class CoversTagTest extends \PHPUnit_Framework_TestCase
|
||||
* @return void
|
||||
*/
|
||||
public function testConstructorParesInputsIntoCorrectFields(
|
||||
$type, $content, $exName, $exContent, $exDescription, $exReference
|
||||
$type,
|
||||
$content,
|
||||
$exName,
|
||||
$exContent,
|
||||
$exDescription,
|
||||
$exReference
|
||||
) {
|
||||
$tag = new CoversTag($type, $content);
|
||||
|
||||
|
||||
@@ -39,7 +39,12 @@ class LinkTagTest extends \PHPUnit_Framework_TestCase
|
||||
* @return void
|
||||
*/
|
||||
public function testConstructorParesInputsIntoCorrectFields(
|
||||
$type, $content, $exName, $exContent, $exDescription, $exLink
|
||||
$type,
|
||||
$content,
|
||||
$exName,
|
||||
$exContent,
|
||||
$exDescription,
|
||||
$exLink
|
||||
) {
|
||||
$tag = new LinkTag($type, $content);
|
||||
|
||||
@@ -89,4 +94,4 @@ class LinkTagTest extends \PHPUnit_Framework_TestCase
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,15 +38,21 @@ class MethodTagTest extends \PHPUnit_Framework_TestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testConstruct($signature, $valid, $expected_name,
|
||||
$expected_return, $has_params, $description
|
||||
public function testConstruct(
|
||||
$signature,
|
||||
$valid,
|
||||
$expected_name,
|
||||
$expected_return,
|
||||
$has_params,
|
||||
$description
|
||||
) {
|
||||
ob_start();
|
||||
$tag = new MethodTag('method', $signature);
|
||||
$stdout = ob_get_clean();
|
||||
|
||||
$this->assertSame(
|
||||
$valid, empty($stdout),
|
||||
$valid,
|
||||
empty($stdout),
|
||||
'No error should have been output if the signature is valid'
|
||||
);
|
||||
|
||||
@@ -54,11 +60,12 @@ class MethodTagTest extends \PHPUnit_Framework_TestCase
|
||||
return;
|
||||
}
|
||||
|
||||
$this->assertEquals($expected_name, $tag->getMethodName());
|
||||
$this->assertEquals($expected_name, $tag->getMethodName());
|
||||
$this->assertEquals($expected_return, $tag->getType());
|
||||
$this->assertEquals($description, $tag->getDescription());
|
||||
$this->assertEquals($description, $tag->getDescription());
|
||||
$this->assertSame(
|
||||
$has_params, (bool)(count($tag->getArguments()) > 0),
|
||||
$has_params,
|
||||
(bool)(count($tag->getArguments()) > 0),
|
||||
'Number of found arguments should exceed 0'
|
||||
);
|
||||
}
|
||||
@@ -120,4 +127,4 @@ class MethodTagTest extends \PHPUnit_Framework_TestCase
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,14 +39,17 @@ class ParamTagTest extends \PHPUnit_Framework_TestCase
|
||||
* @return void
|
||||
*/
|
||||
public function testConstructorParsesInputsIntoCorrectFields(
|
||||
$type, $content, $extracted_type, $extracted_variable_name,
|
||||
$type,
|
||||
$content,
|
||||
$extracted_type,
|
||||
$extracted_variable_name,
|
||||
$extracted_description
|
||||
) {
|
||||
$tag = new ParamTag($type, $content);
|
||||
|
||||
$this->assertEquals($extracted_type, $tag->getTypes());
|
||||
$this->assertEquals($extracted_type, $tag->getTypes());
|
||||
$this->assertEquals($extracted_variable_name, $tag->getVariableName());
|
||||
$this->assertEquals($extracted_description, $tag->getDescription());
|
||||
$this->assertEquals($extracted_description, $tag->getDescription());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -37,12 +37,14 @@ class ReturnTagTest extends ParamTagTest
|
||||
* @return void
|
||||
*/
|
||||
public function testConstructorParsesInputsIntoCorrectFields(
|
||||
$content, $extracted_type, $extracted_description
|
||||
$content,
|
||||
$extracted_type,
|
||||
$extracted_description
|
||||
) {
|
||||
$tag = new ReturnTag('return', $content);
|
||||
|
||||
$this->assertEquals($extracted_type, $tag->getTypes());
|
||||
$this->assertEquals($extracted_description, $tag->getDescription());
|
||||
$this->assertEquals($extracted_type, $tag->getTypes());
|
||||
$this->assertEquals($extracted_description, $tag->getDescription());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -38,7 +38,12 @@ class SeeTagTest extends \PHPUnit_Framework_TestCase
|
||||
* @return void
|
||||
*/
|
||||
public function testConstructorParesInputsIntoCorrectFields(
|
||||
$type, $content, $exName, $exContent, $exDescription, $exReference
|
||||
$type,
|
||||
$content,
|
||||
$exName,
|
||||
$exContent,
|
||||
$exDescription,
|
||||
$exReference
|
||||
) {
|
||||
$tag = new SeeTag($type, $content);
|
||||
|
||||
|
||||
@@ -38,7 +38,12 @@ class UsesTagTest extends \PHPUnit_Framework_TestCase
|
||||
* @return void
|
||||
*/
|
||||
public function testConstructorParesInputsIntoCorrectFields(
|
||||
$type, $content, $exName, $exContent, $exDescription, $exReference
|
||||
$type,
|
||||
$content,
|
||||
$exName,
|
||||
$exContent,
|
||||
$exDescription,
|
||||
$exReference
|
||||
) {
|
||||
$tag = new UsesTag($type, $content);
|
||||
|
||||
|
||||
@@ -38,13 +38,17 @@ class VarTagTest extends \PHPUnit_Framework_TestCase
|
||||
* @return void
|
||||
*/
|
||||
public function testConstructorParesInputsIntoCorrectFields(
|
||||
$type, $content, $exType, $exVariable, $exDescription
|
||||
$type,
|
||||
$content,
|
||||
$exType,
|
||||
$exVariable,
|
||||
$exDescription
|
||||
) {
|
||||
$tag = new VarTag($type, $content);
|
||||
|
||||
$this->assertEquals($exType, $tag->getType());
|
||||
$this->assertEquals($exVariable, $tag->getVariableName());
|
||||
$this->assertEquals($exDescription, $tag->getDescription());
|
||||
$this->assertEquals($exVariable, $tag->getVariableName());
|
||||
$this->assertEquals($exDescription, $tag->getDescription());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -223,6 +223,4 @@ class CollectionTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
return $this->provideTypesToExpand($method, '\\');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,8 @@ class DocBlockTest extends \PHPUnit_Framework_TestCase
|
||||
DOCBLOCK;
|
||||
$object = new DocBlock($fixture);
|
||||
$this->assertEquals(
|
||||
'This is a short description.', $object->getShortDescription()
|
||||
'This is a short description.',
|
||||
$object->getShortDescription()
|
||||
);
|
||||
$this->assertEquals(
|
||||
'This is a long description.',
|
||||
@@ -57,11 +58,13 @@ DOCBLOCK;
|
||||
DOCBLOCK;
|
||||
$object = new DocBlock($fixture);
|
||||
$this->assertEquals(
|
||||
'This is a short description.', $object->getShortDescription()
|
||||
'This is a short description.',
|
||||
$object->getShortDescription()
|
||||
);
|
||||
$this->assertEquals(
|
||||
"This is a long description.\nThis is a continuation of the long "
|
||||
."description.", $object->getLongDescription()->getContents()
|
||||
."description.",
|
||||
$object->getLongDescription()->getContents()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -103,17 +106,21 @@ DOCBLOCK;
|
||||
public function testExpandTypeUsingNamespaceAlias()
|
||||
{
|
||||
$docblock = new DocBlock(
|
||||
'', '\My\Namespace', array('Alias' => '\My\Namespace\Alias')
|
||||
'',
|
||||
'\My\Namespace',
|
||||
array('Alias' => '\My\Namespace\Alias')
|
||||
);
|
||||
|
||||
// first try a normal resolution without alias
|
||||
$this->assertEquals(
|
||||
'\My\Namespace\Al', $docblock->expandType('Al')
|
||||
'\My\Namespace\Al',
|
||||
$docblock->expandType('Al')
|
||||
);
|
||||
|
||||
// try to use the alias
|
||||
$this->assertEquals(
|
||||
'\My\Namespace\Alias\Al', $docblock->expandType('Alias\Al')
|
||||
'\My\Namespace\Alias\Al',
|
||||
$docblock->expandType('Alias\Al')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -145,4 +152,3 @@ DOCBLOCK;
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user