@@ -34,7 +34,9 @@ public function testGetWithHttpClient(): void
3434 $ api = new class ($ client ) extends AbstractApi {};
3535
3636 $ method = new ReflectionMethod ($ api , 'get ' );
37- $ method ->setAccessible (true );
37+ if (PHP_VERSION_ID < 80100 ) {
38+ $ method ->setAccessible (true );
39+ }
3840
3941 // Perform the tests
4042 $ this ->assertSame (
@@ -49,14 +51,16 @@ public function testGetWithHttpClient(): void
4951 #[DataProvider('getJsonDecodingFromGetMethodData ' )]
5052 public function testJsonDecodingFromGetMethod (string $ response , ?bool $ decode , $ expected ): void
5153 {
52- $ client = $ this ->createMock (Client::class);
54+ $ client = $ this ->createStub (Client::class);
5355 $ client ->method ('getLastResponseBody ' )->willReturn ($ response );
5456 $ client ->method ('getLastResponseContentType ' )->willReturn ('application/json ' );
5557
5658 $ api = new class ($ client ) extends AbstractApi {};
5759
5860 $ method = new ReflectionMethod ($ api , 'get ' );
59- $ method ->setAccessible (true );
61+ if (PHP_VERSION_ID < 80100 ) {
62+ $ method ->setAccessible (true );
63+ }
6064
6165 // Perform the tests
6266 if (is_bool ($ decode )) {
@@ -84,14 +88,16 @@ public static function getJsonDecodingFromGetMethodData(): array
8488 #[DataProvider('getXmlDecodingFromGetMethodData ' )]
8589 public function testXmlDecodingFromGetMethod (string $ response , ?bool $ decode , string $ expected ): void
8690 {
87- $ client = $ this ->createMock (Client::class);
91+ $ client = $ this ->createStub (Client::class);
8892 $ client ->method ('getLastResponseBody ' )->willReturn ($ response );
8993 $ client ->method ('getLastResponseContentType ' )->willReturn ('application/xml ' );
9094
9195 $ api = new class ($ client ) extends AbstractApi {};
9296
9397 $ method = new ReflectionMethod ($ api , 'get ' );
94- $ method ->setAccessible (true );
98+ if (PHP_VERSION_ID < 80100 ) {
99+ $ method ->setAccessible (true );
100+ }
95101
96102 // Perform the tests
97103 $ return = $ method ->invoke ($ api , 'path ' , $ decode );
0 commit comments