|
27 | 27 | use phpDocumentor\Reflection\Types\Array_;
|
28 | 28 | use phpDocumentor\Reflection\Types\ArrayKey;
|
29 | 29 | use phpDocumentor\Reflection\Types\Callable_;
|
| 30 | +use phpDocumentor\Reflection\Types\CallableParameter; |
30 | 31 | use phpDocumentor\Reflection\Types\ClassString;
|
31 | 32 | use phpDocumentor\Reflection\Types\Collection;
|
32 | 33 | use phpDocumentor\Reflection\Types\Compound;
|
|
49 | 50 | final class TypeFactoryTest extends TestCase
|
50 | 51 | {
|
51 | 52 | /**
|
52 |
| - * @covers \phpDocumentor\Reflection\DocBlock\Tags\Factory\TypeFactory::createType |
53 |
| - * @covers \phpDocumentor\Reflection\DocBlock\Tags\Factory\TypeFactory::createFromGeneric |
54 |
| - * @covers \phpDocumentor\Reflection\DocBlock\Tags\Factory\TypeFactory::createFromCallable |
| 53 | + * @covers \phpDocumentor\Reflection\DocBlock\Tags\Factory\TypeFactory::createType |
| 54 | + * @covers \phpDocumentor\Reflection\DocBlock\Tags\Factory\TypeFactory::createFromGeneric |
| 55 | + * @covers \phpDocumentor\Reflection\DocBlock\Tags\Factory\TypeFactory::createFromCallable |
55 | 56 | * @dataProvider typeProvider
|
56 | 57 | * @dataProvider genericsProvider
|
57 | 58 | * @dataProvider callableProvider
|
@@ -208,15 +209,49 @@ public function callableProvider(): array
|
208 | 209 | ],
|
209 | 210 | [
|
210 | 211 | 'callable(): Foo',
|
211 |
| - new Callable_(), |
| 212 | + new Callable_([], new Object_(new Fqsen('\\phpDocumentor\\Foo'))), |
212 | 213 | ],
|
213 | 214 | [
|
214 | 215 | 'callable(): (Foo&Bar)',
|
215 |
| - new Callable_(), |
| 216 | + new Callable_( |
| 217 | + [], |
| 218 | + new Intersection( |
| 219 | + [ |
| 220 | + new Object_(new Fqsen('\\phpDocumentor\\Foo')), |
| 221 | + new Object_(new Fqsen('\\phpDocumentor\\Bar')) |
| 222 | + ] |
| 223 | + ) |
| 224 | + ), |
216 | 225 | ],
|
217 | 226 | [
|
218 | 227 | 'callable(A&...$a=, B&...=, C): Foo',
|
219 |
| - new Callable_(), |
| 228 | + new Callable_( |
| 229 | + [ |
| 230 | + new CallableParameter( |
| 231 | + 'a', |
| 232 | + new Object_(new Fqsen('\\phpDocumentor\\A')), |
| 233 | + true, |
| 234 | + true, |
| 235 | + true |
| 236 | + ), |
| 237 | + new CallableParameter( |
| 238 | + null, |
| 239 | + new Object_(new Fqsen('\\phpDocumentor\\B')), |
| 240 | + true, |
| 241 | + true, |
| 242 | + true |
| 243 | + ), |
| 244 | + new CallableParameter( |
| 245 | + null, |
| 246 | + new Object_(new Fqsen('\\phpDocumentor\\C')), |
| 247 | + false, |
| 248 | + false, |
| 249 | + false |
| 250 | + ), |
| 251 | + ], |
| 252 | + new Object_(new Fqsen('\\phpDocumentor\\Foo') |
| 253 | + ) |
| 254 | + ), |
220 | 255 | ],
|
221 | 256 | ];
|
222 | 257 | }
|
|
0 commit comments