File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,35 @@ public function testResolvingArrayCollectionWithKey()
147147 $ this ->assertInstanceOf (Types \Compound::class, $ valueType );
148148 }
149149
150+ /**
151+ * @covers ::__construct
152+ * @covers ::resolve
153+ *
154+ * @uses \phpDocumentor\Reflection\Types\Context
155+ * @uses \phpDocumentor\Reflection\Types\Compound
156+ * @uses \phpDocumentor\Reflection\Types\Collection
157+ * @uses \phpDocumentor\Reflection\Types\String_
158+ */
159+ public function testResolvingArrayCollectionWithKeyAndWhitespace ()
160+ {
161+ $ fixture = new TypeResolver ();
162+
163+ /** @var Collection $resolvedType */
164+ $ resolvedType = $ fixture ->resolve ('array<string, object|array> ' , new Context ('' ));
165+
166+ $ this ->assertInstanceOf (Array_::class, $ resolvedType );
167+ $ this ->assertSame ('array<string,object|array> ' , (string ) $ resolvedType );
168+
169+ /** @var Array_ $valueType */
170+ $ valueType = $ resolvedType ->getValueType ();
171+
172+ /** @var Compound $keyType */
173+ $ keyType = $ resolvedType ->getKeyType ();
174+
175+ $ this ->assertInstanceOf (Types \String_::class, $ keyType );
176+ $ this ->assertInstanceOf (Types \Compound::class, $ valueType );
177+ }
178+
150179 /**
151180 * @covers ::__construct
152181 * @covers ::resolve
You can’t perform that action at this time.
0 commit comments