Skip to content

Commit

Permalink
Add test for string value params
Browse files Browse the repository at this point in the history
shows the correct behavior of #348

fixes #348
  • Loading branch information
jaapio committed Mar 20, 2024
1 parent c9b9e93 commit 7b2f618
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/unit/DocBlock/Tags/Factory/ParamFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@

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
Expand Down Expand Up @@ -87,6 +92,36 @@ public function paramInputProvider(): array
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
),
],
];
}
}

0 comments on commit 7b2f618

Please sign in to comment.