@@ -28,7 +28,12 @@ public function testTypeConvertToDisplayTypeWithNativeType()
2828 $ this ->assertCount (2 , $ nativeParamRefArr );
2929 $ this ->assertEquals (\ReflectionParameter::class, get_class ($ nativeParamRefArr [0 ]));
3030 $ nativeTypeRef = $ nativeParamRefArr [0 ]->getType ();
31- $ this ->assertEquals ('string ' , (string )$ nativeTypeRef );
31+ // TODO: To prevent deprecation error in tests
32+ if (PHP_VERSION_ID < 70400 ) {
33+ $ this ->assertEquals ('string ' , (string )$ nativeTypeRef );
34+ } else {
35+ $ this ->assertEquals ('string ' , $ nativeTypeRef ->getName ());
36+ }
3237 $ this ->assertNotContains ('\\' , get_class ($ nativeTypeRef ));
3338 $ this ->assertInstanceOf (\ReflectionType::class, $ nativeTypeRef );
3439 $ this ->assertEquals ('string ' , \Go \ParserReflection \ReflectionType::convertToDisplayType ($ nativeTypeRef ));
@@ -49,7 +54,12 @@ public function testTypeConvertToDisplayTypeWithNullableNativeType()
4954 $ this ->assertCount (2 , $ nativeParamRefArr );
5055 $ this ->assertEquals (\ReflectionParameter::class, get_class ($ nativeParamRefArr [0 ]));
5156 $ nativeTypeRef = $ nativeParamRefArr [0 ]->getType ();
52- $ this ->assertEquals ('string ' , (string )$ nativeTypeRef );
57+ // TODO: To prevent deprecation error in tests
58+ if (PHP_VERSION_ID < 70400 ) {
59+ $ this ->assertEquals ('string ' , (string )$ nativeTypeRef );
60+ } else {
61+ $ this ->assertEquals ('string ' , $ nativeTypeRef ->getName ());
62+ }
5363 $ this ->assertNotContains ('\\' , get_class ($ nativeTypeRef ));
5464 $ this ->assertInstanceOf (\ReflectionType::class, $ nativeTypeRef );
5565 $ this ->assertEquals ('string or NULL ' , \Go \ParserReflection \ReflectionType::convertToDisplayType ($ nativeTypeRef ));
@@ -71,7 +81,12 @@ public function testTypeConvertToDisplayTypeImplicitlyNullable()
7181 $ this ->assertEquals (\ReflectionParameter::class, get_class ($ nativeParamRefArr [0 ]));
7282 $ nativeTypeRef = $ nativeParamRefArr [0 ]->getType ();
7383 $ this ->assertTrue ($ nativeTypeRef ->allowsNull ());
74- $ this ->assertEquals ('string ' , (string )$ nativeTypeRef );
84+ // TODO: To prevent deprecation error in tests
85+ if (PHP_VERSION_ID < 70400 ) {
86+ $ this ->assertEquals ('string ' , (string )$ nativeTypeRef );
87+ } else {
88+ $ this ->assertEquals ('string ' , $ nativeTypeRef ->getName ());
89+ }
7590 $ this ->assertNotContains ('\\' , get_class ($ nativeTypeRef ));
7691 $ this ->assertInstanceOf (\ReflectionType::class, $ nativeTypeRef );
7792 $ this ->assertEquals ('string or NULL ' , \Go \ParserReflection \ReflectionType::convertToDisplayType ($ nativeTypeRef ));
0 commit comments