Skip to content

Commit 7b2f618

Browse files
committed
Add test for string value params
shows the correct behavior of #348 fixes #348
1 parent c9b9e93 commit 7b2f618

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

tests/unit/DocBlock/Tags/Factory/ParamFactoryTest.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,14 @@
1515

1616
use phpDocumentor\Reflection\DocBlock\Description;
1717
use phpDocumentor\Reflection\DocBlock\Tags\Param;
18+
use phpDocumentor\Reflection\Fqsen;
19+
use phpDocumentor\Reflection\PseudoTypes\IntegerValue;
20+
use phpDocumentor\Reflection\PseudoTypes\StringValue;
21+
use phpDocumentor\Reflection\Types\Compound;
1822
use phpDocumentor\Reflection\Types\Context;
1923
use phpDocumentor\Reflection\Types\Integer;
2024
use phpDocumentor\Reflection\Types\Mixed_;
25+
use phpDocumentor\Reflection\Types\Object_;
2126
use phpDocumentor\Reflection\Types\String_;
2227

2328
final class ParamFactoryTest extends TagFactoryTestCase
@@ -87,6 +92,36 @@ public function paramInputProvider(): array
8792
false
8893
),
8994
],
95+
[
96+
'@param \'GET\'|SomeClass $arg My Description',
97+
new Param(
98+
'arg',
99+
new Compound(
100+
[
101+
new StringValue('GET'),
102+
new Object_(new Fqsen('\SomeClass'))
103+
]
104+
),
105+
false,
106+
new Description('My Description'),
107+
false
108+
),
109+
],
110+
[
111+
'@param 8|SomeClass $arg My Description',
112+
new Param(
113+
'arg',
114+
new Compound(
115+
[
116+
new IntegerValue(8),
117+
new Object_(new Fqsen('\SomeClass'))
118+
]
119+
),
120+
false,
121+
new Description('My Description'),
122+
false
123+
),
124+
],
90125
];
91126
}
92127
}

0 commit comments

Comments
 (0)