Skip to content

Commit 8266a68

Browse files
committed
AC-9030::Fedex API Upgrade - Fix Static tests for Rate API
1 parent ce4b900 commit 8266a68

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

app/code/Magento/Fedex/Model/Source/PickupType.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
* ************************************************************************
1919
*/
2020

21+
declare(strict_types=1);
22+
2123
namespace Magento\Fedex\Model\Source;
2224

2325
/**

app/code/Magento/Fedex/Test/Unit/Model/CarrierTest.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ public function testCollectRatesRateAmountOriginBased(
314314
->willReturn(true);
315315

316316
$accessTokenResponse = $this->getAccessToken();
317-
$rateResponse = $this->getRateResponse($amount);
317+
$rateResponse = $this->getRateResponse($amount, $currencyCode, $rateType);
318318

319319
$this->serializer->method('serialize')
320320
->willReturn('CollectRateString' . $amount);
@@ -632,9 +632,12 @@ public function getTrackResponse($shipTimeStamp, $expectedDate, $expectedTime) :
632632
* Expected Rate Response
633633
*
634634
* @param string $amount
635+
* @param string $currencyCode
636+
* @param string $rateType
635637
* @return array
638+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
636639
*/
637-
public function getRateResponse($amount) : array
640+
public function getRateResponse($amount, $currencyCode, $rateType) : array
638641
{
639642
$rateResponse = '{"transactionId":"9eb0f436-8bb1-4200-b951-ae10442489f3","output":{"alerts":[{"code":
640643
"ORIGIN.STATEORPROVINCECODE.CHANGED","message":"The origin state/province code has been changed.",
@@ -749,9 +752,9 @@ public function getRateResponse($amount) : array
749752
24.26,"totalNetCharge":'.$amount.',"totalNetFedExCharge":28.75,"shipmentRateDetail":{"rateZone":"5","dimDivisor"
750753
:0,"fuelSurchargePercent":18.5,"totalSurcharges":4.49,"totalFreightDiscount":0.0,"surCharges":[{"type":"FUEL",
751754
"description":"Fuel Surcharge","level":"PACKAGE","amount":4.49}],"totalBillingWeight":{"units":"LB","value":
752-
23.0},"currency":"USD"},"ratedPackages":[{"groupNumber":0,"effectiveNetDiscount":0.0,"packageRateDetail":
753-
{"rateType":"PAYOR_LIST_PACKAGE","ratedWeightMethod":"ACTUAL","baseCharge":24.26,"netFreight":24.26,
754-
"totalSurcharges":4.49,"netFedExCharge":28.75,"totalTaxes":0.0,"netCharge":28.75,"totalRebates":0.0,
755+
23.0},"currency":"'.$currencyCode.'"},"ratedPackages":[{"groupNumber":0,"effectiveNetDiscount":0.0,
756+
"packageRateDetail":{"rateType":"'.$rateType.'","ratedWeightMethod":"ACTUAL","baseCharge":24.26,"netFreight":
757+
24.26,"totalSurcharges":4.49,"netFedExCharge":28.75,"totalTaxes":0.0,"netCharge":28.75,"totalRebates":0.0,
755758
"billingWeight":{"units":"KG","value":10.43},"totalFreightDiscounts":0.0,"surcharges":[{"type":"FUEL",
756759
"description":"Fuel Surcharge","level":"PACKAGE","amount":4.49}],"currency":"USD"}}],"currency":"USD"}],
757760
"operationalDetail":{"ineligibleForMoneyBackGuarantee":false,"astraDescription":"FXG","airportId":"ELP",

0 commit comments

Comments
 (0)