Skip to content

Commit

Permalink
Add test for new method
Browse files Browse the repository at this point in the history
  • Loading branch information
dmvdbrugge committed Jul 9, 2018
1 parent e7d1e62 commit 99a7880
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/DocBlock/AnnotationTest.php
Expand Up @@ -342,6 +342,29 @@ public function provideTypesCases()
];
}

/**
* @param string $input
* @param string[] $expected
*
* @dataProvider provideNormalizedTypesCases
*/
public function testNormalizedTypes($input, $expected)
{
$line = new Line($input);
$tag = new Annotation([$line]);

$this->assertSame($expected, $tag->getNormalizedTypes());
}

public function provideNormalizedTypesCases()
{
return [
['* @param StRiNg|NuLl $foo', ['null', 'string']],
['* @return Void', ['void']],
['* @return Foo|Bar|Baz|Qux|null', ['bar', 'baz', 'foo', 'null', 'qux']],
];
}

public function testGetTypesOnBadTag()
{
$this->expectException(\RuntimeException::class);
Expand Down

0 comments on commit 99a7880

Please sign in to comment.