Esempio n. 1
0
 /**
  * @dataProvider wsiDataProvider
  *
  * @param mixed     $actionParams
  * @param mixed     $expectedParams
  * @param \stdClass $remoteResponse
  * @param mixed     $expectedData
  */
 public function testWSICompatibility($actionParams, $expectedParams, $remoteResponse, $expectedData)
 {
     $this->settings->set('wsi_mode', true);
     $this->initSettings(true);
     $testActionName = 'testAction';
     $this->soapClientMock->expects($this->at(3))->method('__soapCall')->with($this->equalTo($testActionName), $this->equalTo([(object) $expectedParams]))->will($this->returnValue($remoteResponse));
     $this->transport->init($this->transportEntity);
     $result = $this->transport->call($testActionName, $actionParams);
     $this->assertEquals($expectedData, $result);
 }
Esempio n. 2
0
 /**
  * Get changes from magento side
  *
  * @param \stdClass $item
  * @param array     $fieldsList
  *
  * @return array
  */
 protected function getCustomerRemoteChangeSet($item, $fieldsList)
 {
     $remoteData = $this->transport->call(SoapTransport::ACTION_CUSTOMER_INFO, ['customerId' => $item->entity->getOriginId(), 'attributes' => $fieldsList]);
     unset($remoteData->customer_id);
     /** cut data */
     $this->fixDataIfExtensionNotInstalled($remoteData);
     $customerLocalData = $this->customerSerializer->getCurrentCustomerValues($item->entity, $fieldsList);
     foreach ($remoteData as $fieldName => $value) {
         if (isset($customerLocalData[$fieldName]) && $customerLocalData[$fieldName] === $value) {
             unset($remoteData->{$fieldName});
         }
     }
     return (array) $remoteData;
 }