/**
  * @expectedException \Magento\Framework\Exception\IntegrationException
  * @expectedExceptionMessage Integration with name 'Another Integration Name' exists.
  */
 public function testUpdateException()
 {
     $this->_integrationMock->expects($this->any())->method('getId')->will($this->returnValue(self::VALUE_INTEGRATION_ID));
     $this->_integrationMock->expects($this->any())->method('load')->will($this->onConsecutiveCalls($this->_integrationMock, $this->_getAnotherIntegrationMock()));
     $this->_integrationMock->expects($this->never())->method('save')->will($this->returnSelf());
     $this->_setValidIntegrationData();
     $integrationData = ['integration_id' => self::VALUE_INTEGRATION_ID, 'name' => self::VALUE_INTEGRATION_ANOTHER_NAME, 'email' => self::VALUE_INTEGRATION_EMAIL, 'endpoint' => self::VALUE_INTEGRATION_ENDPOINT];
     $this->_service->update($integrationData);
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function update(array $integrationData)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'update');
     if (!$pluginInfo) {
         return parent::update($integrationData);
     } else {
         return $this->___callPlugins('update', func_get_args(), $pluginInfo);
     }
 }