public function testFindByConsumerIdNotFound()
 {
     $this->_emptyIntegrationMock->expects($this->any())->method('getData')->will($this->returnValue(null));
     $this->_integrationMock->expects($this->once())->method('load')->with(self::VALUE_INTEGRATION_CONSUMER_ID, 'consumer_id')->will($this->returnValue($this->_emptyIntegrationMock));
     $integration = $this->_service->findByConsumerId(1);
     $this->assertNull($integration->getData());
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function get($integrationId)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'get');
     if (!$pluginInfo) {
         return parent::get($integrationId);
     } else {
         return $this->___callPlugins('get', func_get_args(), $pluginInfo);
     }
 }
예제 #3
0
 /**
  * @param array $integrationData
  * @param array $selectedResources
  * @return \Magento\Integration\Block\Adminhtml\Integration\Edit\Tab\Webapi
  */
 private function getWebapiBlock($integrationData = [], array $selectedResources = [])
 {
     if ($integrationData) {
         if (isset($integrationData['integration_id'])) {
             $this->integrationService->expects($this->once())->method('getSelectedResources')->with($integrationData['integration_id'])->will($this->returnValue($selectedResources));
         }
     }
     $this->registry->expects($this->any())->method('registry')->with(IntegrationController::REGISTRY_KEY_CURRENT_INTEGRATION)->will($this->returnValue($integrationData));
     return $this->objectManager->getObject('Magento\\Integration\\Block\\Adminhtml\\Integration\\Edit\\Tab\\Webapi', ['registry' => $this->registry, 'rootResource' => $this->rootResource, 'aclResourceProvider' => $this->aclResourceProvider, 'integrationData' => $this->integrationHelper, 'integrationService' => $this->integrationService]);
 }