@@ -112,54 +112,6 @@ public function testResolvingKeywords(string $keyword, string $expectedClass): v
112112 $ this ->assertInstanceOf ($ expectedClass , $ resolvedType );
113113 }
114114
115- /**
116- * @uses \phpDocumentor\Reflection\Types\Context
117- * @uses \phpDocumentor\Reflection\Types\Object_
118- * @uses \phpDocumentor\Reflection\Types\String_
119- *
120- * @covers ::__construct
121- * @covers ::resolve
122- * @covers ::createType
123- *
124- * @dataProvider provideClassStrings
125- */
126- public function testResolvingClassStrings (string $ classString , bool $ throwsException ): void
127- {
128- $ fixture = new TypeResolver ();
129-
130- if ($ throwsException ) {
131- $ this ->expectException (RuntimeException::class);
132- }
133-
134- $ resolvedType = $ fixture ->resolve ($ classString , new Context ('' ));
135-
136- $ this ->assertInstanceOf (ClassString::class, $ resolvedType );
137- }
138-
139- /**
140- * @uses \phpDocumentor\Reflection\Types\Context
141- * @uses \phpDocumentor\Reflection\Types\Object_
142- * @uses \phpDocumentor\Reflection\Types\String_
143- *
144- * @covers ::__construct
145- * @covers ::resolve
146- * @covers ::createType
147- *
148- * @dataProvider provideInterfaceStrings
149- */
150- public function testResolvingInterfaceStrings (string $ interfaceString , bool $ throwsException ): void
151- {
152- $ fixture = new TypeResolver ();
153-
154- if ($ throwsException ) {
155- $ this ->expectException (RuntimeException::class);
156- }
157-
158- $ resolvedType = $ fixture ->resolve ($ interfaceString , new Context ('' ));
159-
160- $ this ->assertInstanceOf (InterfaceString::class, $ resolvedType );
161- }
162-
163115 /**
164116 * @uses \phpDocumentor\Reflection\Types\Context
165117 * @uses \phpDocumentor\Reflection\Types\Object_
@@ -811,34 +763,6 @@ public function provideKeywords(): array
811763 ];
812764 }
813765
814- /**
815- * Returns a list of class string types and whether they throw an exception.
816- *
817- * @return (string|bool)[][]
818- */
819- public function provideClassStrings (): array
820- {
821- return [
822- ['class-string<\phpDocumentor\Reflection> ' , false ],
823- ['class-string<\phpDocumentor\Reflection\DocBlock> ' , false ],
824- ['class-string<string> ' , true ],
825- ];
826- }
827-
828- /**
829- * Returns a list of interface string types and whether they throw an exception.
830- *
831- * @return (string|bool)[][]
832- */
833- public function provideInterfaceStrings (): array
834- {
835- return [
836- ['interface-string<\phpDocumentor\Reflection> ' , false ],
837- ['interface-string<\phpDocumentor\Reflection\DocBlock> ' , false ],
838- ['interface-string<string> ' , true ],
839- ];
840- }
841-
842766 /**
843767 * Provides a list of FQSENs to test the resolution patterns with.
844768 *
@@ -1122,15 +1046,37 @@ public function genericsProvider(): array
11221046 ],
11231047 [
11241048 'class-string ' ,
1125- new ClassString (null ),
1049+ new ClassString (),
11261050 ],
11271051 [
11281052 'class-string<Foo> ' ,
1129- new ClassString (new Fqsen ('\\phpDocumentor \\Foo ' )),
1053+ new ClassString (new Object_ (new Fqsen ('\\phpDocumentor \\Foo ' ))),
1054+ ],
1055+ [
1056+ 'class-string<Foo|Bar> ' ,
1057+ new ClassString (
1058+ new Compound ([
1059+ new Object_ (new Fqsen ('\\phpDocumentor \\Foo ' )),
1060+ new Object_ (new Fqsen ('\\phpDocumentor \\Bar ' )),
1061+ ])
1062+ ),
1063+ ],
1064+ [
1065+ 'interface-string ' ,
1066+ new InterfaceString (),
11301067 ],
11311068 [
11321069 'interface-string<Foo> ' ,
1133- new InterfaceString (new Fqsen ('\\phpDocumentor \\Foo ' )),
1070+ new InterfaceString (new Object_ (new Fqsen ('\\phpDocumentor \\Foo ' ))),
1071+ ],
1072+ [
1073+ 'interface-string<Foo|Bar> ' ,
1074+ new InterfaceString (
1075+ new Compound ([
1076+ new Object_ (new Fqsen ('\\phpDocumentor \\Foo ' )),
1077+ new Object_ (new Fqsen ('\\phpDocumentor \\Bar ' )),
1078+ ])
1079+ ),
11341080 ],
11351081 [
11361082 'List<Foo> ' ,
0 commit comments