Skip to content

Commit 11a18d0

Browse files
committed
Add testcase for complex array definitions
1 parent e878a14 commit 11a18d0

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/unit/TypeResolverTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use phpDocumentor\Reflection\Types\Compound;
2020
use phpDocumentor\Reflection\Types\Context;
2121
use phpDocumentor\Reflection\Types\Expression;
22+
use phpDocumentor\Reflection\Types\Integer;
2223
use phpDocumentor\Reflection\Types\Intersection;
2324
use phpDocumentor\Reflection\Types\Iterable_;
2425
use phpDocumentor\Reflection\Types\Null_;
@@ -751,4 +752,18 @@ public function provideFqcn() : array
751752
'class with emoji' => ['\My😁Class'],
752753
];
753754
}
755+
756+
/**
757+
* @uses \phpDocumentor\Reflection\Types\Context
758+
*
759+
* @covers ::__construct
760+
* @covers ::resolve
761+
*/
762+
public function testArrayKeyValueSpecification() : void
763+
{
764+
$fixture = new TypeResolver();
765+
$type = $fixture->resolve('array<string,array<int,string>>', new Context(''));
766+
767+
$this->assertEquals(new Array_(new Array_(new String_(), new Integer()), new String_()), $type);
768+
}
754769
}

0 commit comments

Comments
 (0)