Add test for string value params

shows the correct behavior of #348

fixes #348
This commit is contained in:
Jaapio
2024-03-20 22:16:52 +01:00
parent c9b9e93018
commit 7b2f618fe1
@@ -15,9 +15,14 @@ namespace phpDocumentor\Reflection\DocBlock\Tags\Factory;
use phpDocumentor\Reflection\DocBlock\Description;
use phpDocumentor\Reflection\DocBlock\Tags\Param;
use phpDocumentor\Reflection\Fqsen;
use phpDocumentor\Reflection\PseudoTypes\IntegerValue;
use phpDocumentor\Reflection\PseudoTypes\StringValue;
use phpDocumentor\Reflection\Types\Compound;
use phpDocumentor\Reflection\Types\Context;
use phpDocumentor\Reflection\Types\Integer;
use phpDocumentor\Reflection\Types\Mixed_;
use phpDocumentor\Reflection\Types\Object_;
use phpDocumentor\Reflection\Types\String_;
final class ParamFactoryTest extends TagFactoryTestCase
@@ -87,6 +92,36 @@ final class ParamFactoryTest extends TagFactoryTestCase
false
),
],
[
'@param \'GET\'|SomeClass $arg My Description',
new Param(
'arg',
new Compound(
[
new StringValue('GET'),
new Object_(new Fqsen('\SomeClass'))
]
),
false,
new Description('My Description'),
false
),
],
[
'@param 8|SomeClass $arg My Description',
new Param(
'arg',
new Compound(
[
new IntegerValue(8),
new Object_(new Fqsen('\SomeClass'))
]
),
false,
new Description('My Description'),
false
),
],
];
}
}