@@ -20,7 +20,7 @@ class AbstractApiTest extends TestCase
2020{
2121 public function testCreateWithHttpClientWorks (): void
2222 {
23- $ client = $ this ->createMock (HttpClient::class);
23+ $ client = $ this ->createStub (HttpClient::class);
2424
2525 $ api = new class ($ client ) extends AbstractApi {};
2626
@@ -34,7 +34,7 @@ public function testCreateWithHttpClientWorks(): void
3434
3535 public function testCreateWitClientWorks (): void
3636 {
37- $ client = $ this ->createMock (Client::class);
37+ $ client = $ this ->createStub (Client::class);
3838
3939 $ api = new class ($ client ) extends AbstractApi {};
4040
@@ -57,7 +57,7 @@ public function testCreateWithoutClitentOrHttpClientThrowsException(): void
5757
5858 public function testGetTriggersDeprecationWarning (): void
5959 {
60- $ client = $ this ->createMock (HttpClient::class);
60+ $ client = $ this ->createStub (HttpClient::class);
6161
6262 $ api = new class ($ client ) extends AbstractApi {
6363 public function runGet ($ path )
@@ -85,7 +85,7 @@ function ($errno, $errstr): bool {
8585
8686 public function testGetLastResponseWithHttpClientWorks (): void
8787 {
88- $ client = $ this ->createMock (HttpClient::class);
88+ $ client = $ this ->createStub (HttpClient::class);
8989
9090 $ api = new class ($ client ) extends AbstractApi {};
9191
@@ -94,7 +94,7 @@ public function testGetLastResponseWithHttpClientWorks(): void
9494
9595 public function testPostTriggersDeprecationWarning (): void
9696 {
97- $ client = $ this ->createMock (HttpClient::class);
97+ $ client = $ this ->createStub (HttpClient::class);
9898
9999 $ api = new class ($ client ) extends AbstractApi {
100100 public function runPost ($ path , $ data )
@@ -122,7 +122,7 @@ function ($errno, $errstr): bool {
122122
123123 public function testPutTriggersDeprecationWarning (): void
124124 {
125- $ client = $ this ->createMock (HttpClient::class);
125+ $ client = $ this ->createStub (HttpClient::class);
126126
127127 $ api = new class ($ client ) extends AbstractApi {
128128 public function runPut ($ path , $ data )
@@ -150,7 +150,7 @@ function ($errno, $errstr): bool {
150150
151151 public function testDeleteTriggersDeprecationWarning (): void
152152 {
153- $ client = $ this ->createMock (HttpClient::class);
153+ $ client = $ this ->createStub (HttpClient::class);
154154
155155 $ api = new class ($ client ) extends AbstractApi {
156156 public function runDelete ($ path )
@@ -182,7 +182,7 @@ function ($errno, $errstr): bool {
182182 #[DataProvider('getIsNotNullReturnsCorrectBooleanData ' )]
183183 public function testIsNotNullReturnsCorrectBoolean (bool $ expected , $ value ): void
184184 {
185- $ client = $ this ->createMock (Client::class);
185+ $ client = $ this ->createStub (Client::class);
186186
187187 $ api = new class ($ client ) extends AbstractApi {};
188188
@@ -265,7 +265,7 @@ public function __construct($client)
265265 #[DataProvider('getLastCallFailedData ' )]
266266 public function testLastCallFailedWithClientReturnsCorrectBoolean (int $ statusCode , bool $ expectedBoolean ): void
267267 {
268- $ client = $ this ->createMock (Client::class);
268+ $ client = $ this ->createStub (Client::class);
269269 $ client ->method ('getLastResponseStatusCode ' )->willReturn ($ statusCode );
270270
271271 $ api = new class ($ client ) extends AbstractApi {};
@@ -279,10 +279,10 @@ public function testLastCallFailedWithClientReturnsCorrectBoolean(int $statusCod
279279 #[DataProvider('getLastCallFailedData ' )]
280280 public function testLastCallFailedWithHttpClientReturnsCorrectBoolean (int $ statusCode , bool $ expectedBoolean ): void
281281 {
282- $ response = $ this ->createMock (Response::class);
282+ $ response = $ this ->createStub (Response::class);
283283 $ response ->method ('getStatusCode ' )->willReturn ($ statusCode );
284284
285- $ client = $ this ->createMock (HttpClient::class);
285+ $ client = $ this ->createStub (HttpClient::class);
286286 $ client ->method ('request ' )->willReturn ($ response );
287287
288288 $ api = new class ($ client ) extends AbstractApi {
@@ -373,7 +373,7 @@ public static function getLastCallFailedData(): array
373373 #[DataProvider('retrieveDataData ' )]
374374 public function testRetrieveData (string $ path , string $ contentType , string $ response , array $ expected ): void
375375 {
376- $ client = $ this ->createMock (Client::class);
376+ $ client = $ this ->createStub (Client::class);
377377 $ client ->method ('requestGet ' )->willReturn (true );
378378 $ client ->method ('getLastResponseBody ' )->willReturn ($ response );
379379 $ client ->method ('getLastResponseContentType ' )->willReturn ($ contentType );
@@ -458,7 +458,7 @@ public function testRetrieveDataWith250ResultsMakes3Requests(): void
458458 #[DataProvider('getRetrieveDataToExceptionData ' )]
459459 public function testRetrieveDataThrowsException (string $ response , string $ contentType , string $ expectedException , string $ expectedMessage ): void
460460 {
461- $ client = $ this ->createMock (Client::class);
461+ $ client = $ this ->createStub (Client::class);
462462 $ client ->method ('requestGet ' )->willReturn (true );
463463 $ client ->method ('getLastResponseBody ' )->willReturn ($ response );
464464 $ client ->method ('getLastResponseContentType ' )->willReturn ($ contentType );
@@ -489,7 +489,7 @@ public static function getRetrieveDataToExceptionData(): array
489489 #[DataProvider('getRetrieveAllData ' )]
490490 public function testDeprecatedRetrieveAll (string $ content , string $ contentType , $ expected ): void
491491 {
492- $ client = $ this ->createMock (Client::class);
492+ $ client = $ this ->createStub (Client::class);
493493 $ client ->method ('requestGet ' )->willReturn (true );
494494 $ client ->method ('getLastResponseBody ' )->willReturn ($ content );
495495 $ client ->method ('getLastResponseContentType ' )->willReturn ($ contentType );
@@ -515,7 +515,7 @@ public static function getRetrieveAllData(): array
515515
516516 public function testDeprecatedAttachCustomFieldXML (): void
517517 {
518- $ client = $ this ->createMock (Client::class);
518+ $ client = $ this ->createStub (Client::class);
519519
520520 $ api = new class ($ client ) extends AbstractApi {};
521521
0 commit comments