@@ -28,7 +28,12 @@ public function testTypeConvertToDisplayTypeWithNativeType()
28
28
$ this ->assertCount (2 , $ nativeParamRefArr );
29
29
$ this ->assertEquals (\ReflectionParameter::class, get_class ($ nativeParamRefArr [0 ]));
30
30
$ 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
+ }
32
37
$ this ->assertNotContains ('\\' , get_class ($ nativeTypeRef ));
33
38
$ this ->assertInstanceOf (\ReflectionType::class, $ nativeTypeRef );
34
39
$ this ->assertEquals ('string ' , \Go \ParserReflection \ReflectionType::convertToDisplayType ($ nativeTypeRef ));
@@ -49,7 +54,12 @@ public function testTypeConvertToDisplayTypeWithNullableNativeType()
49
54
$ this ->assertCount (2 , $ nativeParamRefArr );
50
55
$ this ->assertEquals (\ReflectionParameter::class, get_class ($ nativeParamRefArr [0 ]));
51
56
$ 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
+ }
53
63
$ this ->assertNotContains ('\\' , get_class ($ nativeTypeRef ));
54
64
$ this ->assertInstanceOf (\ReflectionType::class, $ nativeTypeRef );
55
65
$ this ->assertEquals ('string or NULL ' , \Go \ParserReflection \ReflectionType::convertToDisplayType ($ nativeTypeRef ));
@@ -71,7 +81,12 @@ public function testTypeConvertToDisplayTypeImplicitlyNullable()
71
81
$ this ->assertEquals (\ReflectionParameter::class, get_class ($ nativeParamRefArr [0 ]));
72
82
$ nativeTypeRef = $ nativeParamRefArr [0 ]->getType ();
73
83
$ 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
+ }
75
90
$ this ->assertNotContains ('\\' , get_class ($ nativeTypeRef ));
76
91
$ this ->assertInstanceOf (\ReflectionType::class, $ nativeTypeRef );
77
92
$ this ->assertEquals ('string or NULL ' , \Go \ParserReflection \ReflectionType::convertToDisplayType ($ nativeTypeRef ));
0 commit comments