File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
src/test/php/lang/ast/syntax/php/unittest Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ public function implements_generic_interface() {
4242 $ t = $ this ->type ('class %T<E> implements ' .$ i ->literal ().'<E> { } ' );
4343
4444 $ c = Primitive::$ STRING ;
45- Assert::equals ([$ c ], $ t ->newGenericType ([$ c ])-> getInterfaces ()[0 ]->genericArguments ());
45+ Assert::equals ([$ c ], Reflection:: type ( $ t ->newGenericType ([$ c ]))-> interfaces ()[0 ]-> class () ->genericArguments ());
4646 }
4747
4848 #[Test]
@@ -60,7 +60,7 @@ public function extends_generic_interface() {
6060 $ t = $ this ->type ('interface %T<E> extends ' .$ i ->literal ().'<E> { } ' );
6161
6262 $ c = Primitive::$ STRING ;
63- Assert::equals ([$ c ], $ t ->newGenericType ([$ c ])-> getInterfaces ()[0 ]->genericArguments ());
63+ Assert::equals ([$ c ], Reflection:: type ( $ t ->newGenericType ([$ c ]))-> interfaces ()[0 ]-> class () ->genericArguments ());
6464 }
6565
6666 #[Test]
Original file line number Diff line number Diff line change @@ -144,14 +144,14 @@ public function run() {
144144
145145 #[Test]
146146 public function generic_type_inside_non_generic_class () {
147- $ q = $ this ->type ('class %T<E> { } ' );
148- $ t = $ this ->type ('class %T {
147+ $ q = $ this ->declare ('class %T<E> { } ' );
148+ $ t = $ this ->declare ('class %T {
149149 public function all( ' .$ q ->literal ().'<?> $queue): iterable { /* Not implemented */ }
150150 } ' );
151151
152152 Assert::equals (
153- new WildcardType ($ q , [Wildcard::$ ANY ]),
154- $ t ->getMethod ('all ' )->getParameter (0 )->getType ()
153+ new WildcardType ($ q-> class () , [Wildcard::$ ANY ]),
154+ $ t ->method ('all ' )->parameter (0 )->constraint ()-> type ()
155155 );
156156 }
157157}
You can’t perform that action at this time.
0 commit comments