diff --git a/src/PayPal/Order/CommandHandler/CapturePayPalOrderCommandHandler.php b/src/PayPal/Order/CommandHandler/CapturePayPalOrderCommandHandler.php index 44094fe3a..b3fade10a 100644 --- a/src/PayPal/Order/CommandHandler/CapturePayPalOrderCommandHandler.php +++ b/src/PayPal/Order/CommandHandler/CapturePayPalOrderCommandHandler.php @@ -22,11 +22,9 @@ namespace PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler; use Configuration; -use Context; use PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext; use PrestaShop\Module\PrestashopCheckout\Customer\ValueObject\CustomerId; use PrestaShop\Module\PrestashopCheckout\Event\EventDispatcherInterface; -use PrestaShop\Module\PrestashopCheckout\Exception\HttpTimeoutException; use PrestaShop\Module\PrestashopCheckout\Exception\PsCheckoutException; use PrestaShop\Module\PrestashopCheckout\Http\MaaslandHttpClient; use PrestaShop\Module\PrestashopCheckout\PayPal\Customer\ValueObject\PayPalCustomerId; diff --git a/tests/Unit/Http/MaaslandHttpClientTest.php b/tests/Unit/Http/MaaslandHttpClientTest.php index dd0a946e2..212b8d261 100644 --- a/tests/Unit/Http/MaaslandHttpClientTest.php +++ b/tests/Unit/Http/MaaslandHttpClientTest.php @@ -22,7 +22,6 @@ use Http\Client\Exception\HttpException; use PHPUnit\Framework\TestCase; -use PrestaShop\Module\PrestashopCheckout\Exception\HttpTimeoutException; use PrestaShop\Module\PrestashopCheckout\Exception\PayPalException; use PrestaShop\Module\PrestashopCheckout\Http\HttpClientInterface; use PrestaShop\Module\PrestashopCheckout\Http\MaaslandHttpClient; @@ -120,26 +119,6 @@ public function testNotAuthorizedErrorsCaptureOrderLegacy($errorName, $errorCode $this->handleTestErrorsCaptureOrder(401, $errorName, $errorCode); } - public function testTimeoutCaptureOrder() - { - $streamMock = $this->createMock(StreamInterface::class); - $streamMock->method('__toString')->willReturn(json_encode([])); - $responseMock = $this->createMock(ResponseInterface::class); - $responseMock->method('getStatusCode')->willReturn(504); - $responseMock->method('getBody')->willReturn($streamMock); - $httpClient = $this->createMock(HttpClientInterface::class); - $httpClient->method('sendRequest')->willThrowException(new HttpTimeoutException()); - - $maaslandHttpClient = new MaaslandHttpClient($httpClient); - - $httpClient->expects($this->exactly(4)) - ->method('sendRequest'); - - $this->expectException(HttpTimeoutException::class); - - $maaslandHttpClient->captureOrder([], [], 3); - } - /** * @param int $statusCode * @param string $errorName