@@ -204,6 +204,40 @@ public function testResolvingCompoundTypes()
204
204
$ this ->assertInstanceOf ('phpDocumentor\Reflection\Fqsen ' , $ secondType ->getFqsen ());
205
205
}
206
206
207
+ /**
208
+ * @covers ::__construct
209
+ * @covers ::resolve
210
+ * @covers ::<private>
211
+ *
212
+ * @uses phpDocumentor\Reflection\Types\Context
213
+ * @uses phpDocumentor\Reflection\Types\Compound
214
+ * @uses phpDocumentor\Reflection\Types\Array_
215
+ * @uses phpDocumentor\Reflection\Types\Object_
216
+ * @uses phpDocumentor\Reflection\Fqsen
217
+ * @uses phpDocumentor\Reflection\FqsenResolver
218
+ */
219
+ public function testResolvingCompoundTypedArrayTypes ()
220
+ {
221
+ $ fixture = new TypeResolver ();
222
+
223
+ /** @var Compound $resolvedType */
224
+ $ resolvedType = $ fixture ->resolve ('\stdClass[]|Reflection\DocBlock[] ' , new Context ('phpDocumentor ' ));
225
+
226
+ $ this ->assertInstanceOf ('phpDocumentor\Reflection\Types\Compound ' , $ resolvedType );
227
+ $ this ->assertSame ('\stdClass[]|\phpDocumentor\Reflection\DocBlock[] ' , (string )$ resolvedType );
228
+
229
+ /** @var Array_ $secondType */
230
+ $ firstType = $ resolvedType ->get (0 );
231
+
232
+ /** @var Array_ $secondType */
233
+ $ secondType = $ resolvedType ->get (1 );
234
+
235
+ $ this ->assertInstanceOf ('phpDocumentor\Reflection\Types\Array_ ' , $ firstType );
236
+ $ this ->assertInstanceOf ('phpDocumentor\Reflection\Types\Array_ ' , $ secondType );
237
+ $ this ->assertInstanceOf ('phpDocumentor\Reflection\Types\Object_ ' , $ firstType ->getValueType ());
238
+ $ this ->assertInstanceOf ('phpDocumentor\Reflection\Types\Object_ ' , $ secondType ->getValueType ());
239
+ }
240
+
207
241
/**
208
242
* This test asserts that the parameter order is correct.
209
243
*
0 commit comments