diff --git a/tests/DocBlock/AnnotationTest.php b/tests/DocBlock/AnnotationTest.php index 26343f1cc8b..b73006925d1 100644 --- a/tests/DocBlock/AnnotationTest.php +++ b/tests/DocBlock/AnnotationTest.php @@ -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);