From 8fbefb7d534d31f46a77da22681037603cc1d78b Mon Sep 17 00:00:00 2001 From: Andre Luiz Fernandes Date: Wed, 30 Oct 2024 16:03:29 -0300 Subject: [PATCH] v1.8.5 --- .../Unit/Gateway/Config/ConfigCheckoutCreditsTest.php | 2 +- .../Http/Client/CreateOrderPaymentCustomClientTest.php | 2 +- Tests/Unit/Gateway/Request/MpDeviceSessionIdTest.php | 10 +++++----- .../Model/Notification/Refund/CheckoutCustomTest.php | 10 +++++++++- bin/validate-version.sh | 0 5 files changed, 16 insertions(+), 8 deletions(-) mode change 100755 => 100644 bin/validate-version.sh diff --git a/Tests/Unit/Gateway/Config/ConfigCheckoutCreditsTest.php b/Tests/Unit/Gateway/Config/ConfigCheckoutCreditsTest.php index 2833517..a9ec32f 100644 --- a/Tests/Unit/Gateway/Config/ConfigCheckoutCreditsTest.php +++ b/Tests/Unit/Gateway/Config/ConfigCheckoutCreditsTest.php @@ -226,7 +226,7 @@ public function testGetBannerTextHowToUse() ); $result = $configCheckoutCredits->getBannerText($textId, $storeId); - + $this->assertEquals('Compre em até 12x sem cartão de crédito', $result); } } diff --git a/Tests/Unit/Gateway/Http/Client/CreateOrderPaymentCustomClientTest.php b/Tests/Unit/Gateway/Http/Client/CreateOrderPaymentCustomClientTest.php index 4700972..cafa108 100644 --- a/Tests/Unit/Gateway/Http/Client/CreateOrderPaymentCustomClientTest.php +++ b/Tests/Unit/Gateway/Http/Client/CreateOrderPaymentCustomClientTest.php @@ -34,7 +34,7 @@ private function getTestClass(Sdk $sdkMock): CreateOrderPaymentCustomClient ->willReturn($sdkMock); return new CreateOrderPaymentCustomClient( - $logger, + $logger, $config, $json, $quoteMpPaymentRepository, diff --git a/Tests/Unit/Gateway/Request/MpDeviceSessionIdTest.php b/Tests/Unit/Gateway/Request/MpDeviceSessionIdTest.php index 17a60fa..c31d581 100644 --- a/Tests/Unit/Gateway/Request/MpDeviceSessionIdTest.php +++ b/Tests/Unit/Gateway/Request/MpDeviceSessionIdTest.php @@ -15,12 +15,12 @@ public function testBuildWithSession() ->method('getAdditionalInformation') ->with(MpDeviceSessionId::MP_DEVICE_SESSION_ID) ->willReturn('arm:1234'); - + $paymentDataObjectMock = $this->createMock(PaymentDataObject::class); $paymentDataObjectMock->expects($this->once()) ->method('getPayment') ->willReturn($paymentInterceptorMock); - + $class = new MpDeviceSessionId(); $result = $class->build(['payment' => $paymentDataObjectMock]); @@ -35,12 +35,12 @@ public function testBuildWithoutSession() ->method('getAdditionalInformation') ->with(MpDeviceSessionId::MP_DEVICE_SESSION_ID) ->willReturn(null); - + $paymentDataObjectMock = $this->createMock(PaymentDataObject::class); $paymentDataObjectMock->expects($this->once()) ->method('getPayment') ->willReturn($paymentInterceptorMock); - + $class = new MpDeviceSessionId(); $result = $class->build(['payment' => $paymentDataObjectMock]); @@ -51,7 +51,7 @@ public function testBuildWithoutSession() public function testBuildWithoutPayment() { $this->expectException(\InvalidArgumentException::class); - + $class = new MpDeviceSessionId(); $class->build([]); } diff --git a/Tests/Unit/Model/Notification/Refund/CheckoutCustomTest.php b/Tests/Unit/Model/Notification/Refund/CheckoutCustomTest.php index 99fb668..b72e441 100644 --- a/Tests/Unit/Model/Notification/Refund/CheckoutCustomTest.php +++ b/Tests/Unit/Model/Notification/Refund/CheckoutCustomTest.php @@ -287,7 +287,15 @@ public function testPartialRefundWithSingleCard() $creditMemo = $mocks['creditMemo']; // VALIDATE CREDITMEMO DURING REFUND - $creditMemo->expects($this->any()) + $this->order->expects($this->once()) + ->method('getTotalPaid') + ->willReturn(1000); + + $this->order->expects($this->once()) + ->method('getTotalRefunded') + ->willReturn(500); + + $creditMemo->expects($this->once()) ->method('getBaseGrandTotal') ->willReturn(130.00); diff --git a/bin/validate-version.sh b/bin/validate-version.sh old mode 100755 new mode 100644