Skip to content

Commit

Permalink
Removed redundant test
Browse files Browse the repository at this point in the history
  • Loading branch information
L3RAZ committed Oct 23, 2024
1 parent fbe47b8 commit 5e911aa
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
21 changes: 0 additions & 21 deletions tests/Unit/Http/MaaslandHttpClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5e911aa

Please sign in to comment.