@@ -237,13 +237,12 @@ public function testSendNotSuccessfulCaptureWhenStatusRequestFails(): void
237
237
238
238
/**
239
239
* Tests if {@see CaptureRequest::send} returns an unsuccessful {@see CaptureResponse} when trying to capture
240
- * an already captured payment.
240
+ * an incorrect payment ID .
241
241
*
242
242
* @depends testSendSuccessfulCapture
243
243
*/
244
244
public function testSendNotSuccessfulCaptureWhenPaymentIdIncorrect (): void
245
245
{
246
- $ this ->markTestIncomplete ();
247
246
$ this ->soapClientMock ->expects ($ this ->exactly (2 ))
248
247
->method ('__soapCall ' )
249
248
->withConsecutive (
@@ -290,12 +289,12 @@ public function testSendNotSuccessfulCaptureWhenPaymentIdIncorrect(): void
290
289
}
291
290
292
291
/**
293
- * Tests if {@see CaptureRequest::send} returns an unsuccessful {@see CaptureResponse} when trying to capture
292
+ * Tests if {@see CaptureRequest::send} returns a successful {@see CaptureResponse} when trying to capture
294
293
* an already captured payment.
295
294
*
296
295
* @depends testSendSuccessfulCapture
297
296
*/
298
- public function testSendNotSuccessfulCaptureWhenAlreadyCaptured (): void
297
+ public function testSendSuccessfulCaptureWhenAlreadyCaptured (): void
299
298
{
300
299
$ this ->soapClientMock ->expects ($ this ->exactly (2 ))
301
300
->method ('__soapCall ' )
@@ -334,9 +333,14 @@ public function testSendNotSuccessfulCaptureWhenAlreadyCaptured(): void
334
333
335
334
$ response = $ this ->request ->send ();
336
335
337
- $ this ->assertFalse ($ response ->isSuccessful ());
336
+ $ this ->assertTrue ($ response ->isSuccessful ());
337
+ $ this ->assertSame ('No amount authorized available to capture. ' , $ response ->getMessage ());
338
338
339
339
$ expectedData = $ this ->createCaptureAlreadyCapturedErrorResponse ();
340
+ $ expectedData ->captureSuccess = new stdClass ();
341
+ $ expectedData ->captureSuccess ->success = new stdClass ();
342
+ $ expectedData ->captureSuccess ->success ->code = 'SUCCESS ' ;
343
+ $ expectedData ->captureSuccess ->success ->_ = 'No amount authorized available to capture. ' ;
340
344
$ expectedData ->statusSuccess = $ this ->createStatusSuccessResponseWithAlreadyCapturedPayment ()->statusSuccess ;
341
345
342
346
$ this ->assertEquals ($ expectedData , $ response ->getData ());
0 commit comments