public function testAssignData()
 {
     $ccType = 'VI';
     $ccOwner = 'John Doe';
     $ccExpMonth = '10';
     $ccExpYear = '2020';
     $ccLast4 = '9216';
     $ccToken = 'erf6re';
     $paymentMethodNonce = 'nonce';
     $storeInVault = true;
     $deviceData = 'mobile';
     $data = ['cc_type' => $ccType, 'cc_owner' => $ccOwner, 'cc_exp_month' => $ccExpMonth, 'cc_exp_year' => $ccExpYear, 'cc_last4' => $ccLast4, 'cc_token' => $ccToken, 'payment_method_nonce' => $paymentMethodNonce, 'store_in_vault' => $storeInVault, 'device_data' => $deviceData];
     $data = new \Magento\Framework\DataObject($data);
     $this->model->setInfoInstance($this->infoInstanceMock);
     $this->configMock->expects($this->once())->method('getConfigData')->with('fraudprotection')->willReturn(1);
     $this->infoInstanceMock->expects($this->once())->method('setCcType')->with($ccType)->willReturnSelf();
     $this->infoInstanceMock->expects($this->once())->method('setCcOwner')->with($ccOwner)->willReturnSelf();
     $this->infoInstanceMock->expects($this->once())->method('setCcLast4')->with(false)->willReturnSelf();
     $this->infoInstanceMock->expects($this->once())->method('setCcNumber')->with(null)->willReturnSelf();
     $this->infoInstanceMock->expects($this->once())->method('setCcCid')->with(null)->willReturnSelf();
     $this->infoInstanceMock->expects($this->once())->method('setCcExpMonth')->with($ccExpMonth)->willReturnSelf();
     $this->infoInstanceMock->expects($this->once())->method('setCcExpYear')->with($ccExpYear)->willReturnSelf();
     $this->infoInstanceMock->expects($this->once())->method('setCcSsIssue')->with(null)->willReturnSelf();
     $this->infoInstanceMock->expects($this->once())->method('setCcSsStartMonth')->with(null)->willReturnSelf();
     $this->infoInstanceMock->expects($this->once())->method('setCcSsStartYear')->with(null)->willReturnSelf();
     $this->infoInstanceMock->expects($this->at(10))->method('setAdditionalInformation')->with('device_data', $deviceData);
     $this->infoInstanceMock->expects($this->at(11))->method('setAdditionalInformation')->with('cc_last4', $ccLast4);
     $this->infoInstanceMock->expects($this->at(12))->method('setAdditionalInformation')->with('cc_token', $ccToken);
     $this->infoInstanceMock->expects($this->at(13))->method('setAdditionalInformation')->with('payment_method_nonce', $paymentMethodNonce);
     $this->infoInstanceMock->expects($this->at(14))->method('setAdditionalInformation')->with('store_in_vault', $storeInVault);
     $this->model->assignData($data);
 }
 public function testAssignData()
 {
     $ccType = 'VI';
     $ccExpMonth = '10';
     $ccExpYear = '2020';
     $ccLast4 = '9216';
     $ccToken = 'erf6re';
     $paymentMethodNonce = 'nonce';
     $storeInVault = true;
     $deviceData = 'mobile';
     $data = ['additional_data' => ['cc_type' => $ccType, 'cc_exp_month' => $ccExpMonth, 'cc_exp_year' => $ccExpYear, 'cc_last4' => $ccLast4, 'cc_token' => $ccToken, 'payment_method_nonce' => $paymentMethodNonce, 'store_in_vault' => $storeInVault, 'device_data' => $deviceData]];
     $data = new \Magento\Framework\DataObject($data);
     $this->model->setInfoInstance($this->infoInstanceMock);
     $this->configMock->expects($this->once())->method('getConfigData')->with('fraudprotection')->willReturn(1);
     $this->infoInstanceMock->expects($this->once())->method('setCcType')->with($ccType)->willReturnSelf();
     $this->infoInstanceMock->expects($this->once())->method('setCcLast4')->with($ccLast4)->willReturnSelf();
     $this->infoInstanceMock->expects($this->once())->method('setCcExpMonth')->with($ccExpMonth)->willReturnSelf();
     $this->infoInstanceMock->expects($this->once())->method('setCcExpYear')->with($ccExpYear)->willReturnSelf();
     $this->infoInstanceMock->expects($this->atLeastOnce())->method('setAdditionalInformation')->willReturnMap([['device_data', $deviceData], ['cc_last4', $ccLast4], ['cc_token', $ccToken], ['payment_method_nonce', $paymentMethodNonce], ['store_in_vault', $storeInVault]]);
     $this->model->assignData($data);
 }