@@ -251,6 +251,37 @@ public function testResolvingCompoundTypes() : void
251
251
$ this ->assertInstanceOf (Fqsen::class, $ secondType ->getFqsen ());
252
252
}
253
253
254
+ /**
255
+ * @uses \phpDocumentor\Reflection\Types\Context
256
+ * @uses \phpDocumentor\Reflection\Types\Compound
257
+ * @uses \phpDocumentor\Reflection\Types\String_
258
+ * @uses \phpDocumentor\Reflection\Types\Object_
259
+ * @uses \phpDocumentor\Reflection\Fqsen
260
+ * @uses \phpDocumentor\Reflection\FqsenResolver
261
+ *
262
+ * @covers ::__construct
263
+ * @covers ::resolve
264
+ * @covers ::<private>
265
+ */
266
+ public function testResolvingAmpersandCompoundTypes () : void
267
+ {
268
+ $ fixture = new TypeResolver ();
269
+
270
+ $ resolvedType = $ fixture ->resolve ('Reflection\DocBlock&\PHPUnit\Framework\MockObject\MockObject ' , new Context ('phpDocumentor ' ));
271
+
272
+ $ this ->assertInstanceOf (Compound::class, $ resolvedType );
273
+ $ this ->assertSame ('\phpDocumentor\Reflection\DocBlock&\PHPUnit\Framework\MockObject\MockObject ' , (string ) $ resolvedType );
274
+
275
+ $ firstType = $ resolvedType ->get (0 );
276
+
277
+ $ secondType = $ resolvedType ->get (1 );
278
+
279
+ $ this ->assertInstanceOf (Object_::class, $ firstType );
280
+ $ this ->assertInstanceOf (Fqsen::class, $ firstType ->getFqsen ());
281
+ $ this ->assertInstanceOf (Object_::class, $ secondType );
282
+ $ this ->assertInstanceOf (Fqsen::class, $ secondType ->getFqsen ());
283
+ }
284
+
254
285
/**
255
286
* @uses \phpDocumentor\Reflection\Types\Context
256
287
* @uses \phpDocumentor\Reflection\Types\Compound
0 commit comments