Skip to content

Commit 2f58d24

Browse files
committed
MAGETWO-61561: Card is not saved after checkout with Braintree Credit Card using Vault
- Update unit test
1 parent 9960983 commit 2f58d24

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

app/code/Magento/Braintree/Test/Unit/Model/PaymentMethodTest.php

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -276,17 +276,25 @@ public function testAssignData()
276276
->with($ccExpYear)
277277
->willReturnSelf();
278278

279-
$this->infoInstanceMock->expects($this->atLeastOnce())
279+
$this->infoInstanceMock->expects($this->at(0))
280280
->method('setAdditionalInformation')
281-
->willReturnMap(
282-
[
283-
['device_data', $deviceData],
284-
['cc_last4', $ccLast4],
285-
['cc_token', $ccToken],
286-
['payment_method_nonce', $paymentMethodNonce],
287-
['store_in_vault', $storeInVault]
288-
]
289-
);
281+
->with('device_data', $deviceData);
282+
283+
$this->infoInstanceMock->expects($this->at(1))
284+
->method('setAdditionalInformation')
285+
->with('cc_last4', $ccLast4);
286+
287+
$this->infoInstanceMock->expects($this->at(2))
288+
->method('setAdditionalInformation')
289+
->with('cc_token', $ccToken);
290+
291+
$this->infoInstanceMock->expects($this->at(3))
292+
->method('setAdditionalInformation')
293+
->with('store_in_vault', $storeInVault);
294+
295+
$this->infoInstanceMock->expects($this->at(4))
296+
->method('setAdditionalInformation')
297+
->with('payment_method_nonce', $paymentMethodNonce);
290298

291299
$this->model->assignData($data);
292300
}

0 commit comments

Comments
 (0)