88use PHPStan \Analyser \Scope ;
99use PHPStan \Reflection \MethodReflection ;
1010use PHPStan \Type \ArrayType ;
11- use PHPStan \Type \CommonUnionType ;
1211use PHPStan \Type \FalseBooleanType ;
1312use PHPStan \Type \IterableIterableType ;
1413use PHPStan \Type \MixedType ;
1514use PHPStan \Type \ObjectType ;
1615use PHPStan \Type \TrueBooleanType ;
16+ use PHPStan \Type \UnionType ;
1717
1818final class FormContainerValuesDynamicReturnTypeExtensionTest extends \PHPUnit \Framework \TestCase
1919{
@@ -31,7 +31,7 @@ public function testParameterAsArray()
3131 $ methodReflection = $ this ->createMock (MethodReflection::class);
3232 $ methodReflection
3333 ->method ('getReturnType ' )
34- ->willReturn (new CommonUnionType ([new ArrayType (new MixedType ()), new IterableIterableType (new ObjectType (\Nette \Utils \ArrayHash::class))]));
34+ ->willReturn (new UnionType ([new ArrayType (new MixedType ()), new IterableIterableType (new ObjectType (\Nette \Utils \ArrayHash::class))]));
3535
3636 $ scope = $ this ->createMock (Scope::class);
3737 $ scope ->method ('getType ' )->willReturn (new TrueBooleanType ());
@@ -57,7 +57,7 @@ public function testParameterAsArrayHash()
5757 $ methodReflection = $ this ->createMock (MethodReflection::class);
5858 $ methodReflection
5959 ->method ('getReturnType ' )
60- ->willReturn (new CommonUnionType ([new ArrayType (new MixedType ()), new IterableIterableType (new ObjectType (\Nette \Utils \ArrayHash::class))]));
60+ ->willReturn (new UnionType ([new ArrayType (new MixedType ()), new IterableIterableType (new ObjectType (\Nette \Utils \ArrayHash::class))]));
6161
6262 $ scope = $ this ->createMock (Scope::class);
6363 $ scope ->method ('getType ' )->willReturn (new FalseBooleanType ());
@@ -76,15 +76,15 @@ public function testParameterAsArrayHash()
7676 $ resultType = $ this ->extension ->getTypeFromMethodCall ($ methodReflection , $ methodCall , $ scope );
7777
7878 $ this ->assertInstanceOf (ObjectType::class, $ resultType );
79- $ this ->assertSame (\Nette \Utils \ArrayHash::class, $ resultType ->getClass ());
79+ $ this ->assertSame (\Nette \Utils \ArrayHash::class, $ resultType ->describe ());
8080 }
8181
8282 public function testDefaultParameterIsArrayHash ()
8383 {
8484 $ methodReflection = $ this ->createMock (MethodReflection::class);
8585 $ methodReflection
8686 ->method ('getReturnType ' )
87- ->willReturn (new CommonUnionType ([new ArrayType (new MixedType ()), new IterableIterableType (new ObjectType (\Nette \Utils \ArrayHash::class))]));
87+ ->willReturn (new UnionType ([new ArrayType (new MixedType ()), new IterableIterableType (new ObjectType (\Nette \Utils \ArrayHash::class))]));
8888
8989 $ scope = $ this ->createMock (Scope::class);
9090 $ scope ->method ('getType ' )->willReturn (new FalseBooleanType ());
@@ -96,7 +96,7 @@ public function testDefaultParameterIsArrayHash()
9696 $ resultType = $ this ->extension ->getTypeFromMethodCall ($ methodReflection , $ methodCall , $ scope );
9797
9898 $ this ->assertInstanceOf (ObjectType::class, $ resultType );
99- $ this ->assertSame (\Nette \Utils \ArrayHash::class, $ resultType ->getClass ());
99+ $ this ->assertSame (\Nette \Utils \ArrayHash::class, $ resultType ->describe ());
100100 }
101101
102102}
0 commit comments