You are here

public function MethodTagTest::testConstruct in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php \phpDocumentor\Reflection\DocBlock\Tag\MethodTagTest::testConstruct()

@covers \phpDocumentor\Reflection\DocBlock\Tag\MethodTag @dataProvider getTestSignatures

Parameters

string $signature The signature to test.:

bool $valid Whether the given signature is expected to: be valid.

string $expected_name The method name that is expected from this: signature.

string $expected_return The return type that is expected from this: signature.

bool $paramCount Number of parameters in the signature.:

string $description The short description mentioned in the: signature.

Return value

void

File

vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php, line 42

Class

MethodTagTest
Test class for \phpDocumentor\Reflection\DocBlock\Tag\MethodTag

Namespace

phpDocumentor\Reflection\DocBlock\Tag

Code

public function testConstruct($signature, $valid, $expected_name, $expected_return, $expected_isStatic, $paramCount, $description) {
  ob_start();
  $tag = new MethodTag('method', $signature);
  $stdout = ob_get_clean();
  $this
    ->assertSame($valid, empty($stdout), 'No error should have been output if the signature is valid');
  if (!$valid) {
    return;
  }
  $this
    ->assertEquals($expected_name, $tag
    ->getMethodName());
  $this
    ->assertEquals($expected_return, $tag
    ->getType());
  $this
    ->assertEquals($description, $tag
    ->getDescription());
  $this
    ->assertEquals($expected_isStatic, $tag
    ->isStatic());
  $this
    ->assertCount($paramCount, $tag
    ->getArguments());
}