Skip to content

Commit fcf588d

Browse files
author
Robert He
committed
MAGETWO-33665 : Refactor Quote module to use mutable data object interfaces
-- fixes from code review -- fixes to testcases
1 parent 178b484 commit fcf588d

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

app/code/Magento/Quote/Api/Data/PaymentInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ public function getAdditionalData();
143143
/**
144144
* Set payment additional details
145145
*
146-
* @param string[] $additionalData
146+
* @param string $additionalData
147147
* @return $this
148148
*/
149-
public function setAdditionalData(array $additionalData = null);
149+
public function setAdditionalData($additionalData);
150150
}

app/code/Magento/Quote/Model/Cart/ShippingMethod.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public function getCarrierCode()
2828
/**
2929
* Sets the shipping carrier code.
3030
*
31+
* @param string $carrierCode
3132
* @return $this
3233
*/
3334
public function setCarrierCode($carrierCode)
@@ -48,6 +49,7 @@ public function getMethodCode()
4849
/**
4950
* Sets the shipping method code.
5051
*
52+
* @param string $methodCode
5153
* @return $this
5254
*/
5355
public function setMethodCode($methodCode)
@@ -68,6 +70,7 @@ public function getCarrierTitle()
6870
/**
6971
* Sets the shipping carrier title.
7072
*
73+
* @param string $carrierTitle
7174
* @return $this
7275
*/
7376
public function setCarrierTitle($carrierTitle)
@@ -88,6 +91,7 @@ public function getMethodTitle()
8891
/**
8992
* Sets the shipping method title.
9093
*
94+
* @param string $methodTitle
9195
* @return $this
9296
*/
9397
public function setMethodTitle($methodTitle)
@@ -108,6 +112,7 @@ public function getAmount()
108112
/**
109113
* Sets the shipping amount in store currency.
110114
*
115+
* @param float $amount
111116
* @return $this
112117
*/
113118
public function setAmount($amount)
@@ -128,6 +133,7 @@ public function getBaseAmount()
128133
/**
129134
* Sets the shipping amount in base currency.
130135
*
136+
* @param float $baseAmount
131137
* @return $this
132138
*/
133139
public function setBaseAmount($baseAmount)
@@ -149,6 +155,7 @@ public function getAvailable()
149155
/**
150156
* Sets the value of the availability flag for the current shipping method.
151157
*
158+
* @param bool $available
152159
* @return $this
153160
*/
154161
public function setAvailable($available)

app/code/Magento/Quote/Model/Quote/Payment.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,10 @@ public function getAdditionalData()
404404
/**
405405
* Set payment additional details
406406
*
407-
* @param string[] $additionalData
407+
* @param string $additionalData
408408
* @return $this
409409
*/
410-
public function setAdditionalData(array $additionalData = null)
410+
public function setAdditionalData($additionalData)
411411
{
412412
return $this->setData(self::KEY_ADDITIONAL_DATA, $additionalData);
413413
}

dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCreateTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ protected function prepareOrder()
5757
$orderItem->setSku('sku#1');
5858
if (TESTS_WEB_API_ADAPTER == self::ADAPTER_SOAP) {
5959
$orderItem->setData('parent_item', $orderItem->getData() + ['parent_item' => null]);
60-
$orderItem->setAdditionalData(['test']);
60+
$orderItem->setAdditionalData('test');
6161
} else {
6262
$orderItem->setData('parent_item', ['weight' => 1]);
6363
}

dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_payment_saved.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@
2222
->setCcType('visa')
2323
->setCcExpYear(2014)
2424
->setCcExpMonth(1)
25-
->setAdditionalData($paymentDetails);
25+
->setAdditionalData(serialize($paymentDetails));
2626

2727
$quote->collectTotals()->save();

0 commit comments

Comments
 (0)