public function testConfigBasedIntegrationCreation() { $this->assertEquals('*****@*****.**', $this->integration->getEmail()); $this->assertEquals('http://example.com/endpoint1', $this->integration->getEndpoint()); $this->assertEquals('Test Integration1', $this->integration->getName()); $this->assertEquals(Integration::TYPE_CONFIG, $this->integration->getSetupType()); }
/** * Add the list of allowed resources to the integration object data by 'resource' key. * * @param IntegrationModel $integration * @return void */ protected function _addAllowedResources(IntegrationModel $integration) { $integrations = array_merge($this->integrationConfig->getIntegrations(), $this->consolidatedConfig->getIntegrations()); if ($integration->getId()) { if ($integration->getSetupType() == IntegrationModel::TYPE_CONFIG) { $integration->setData('resource', $integrations[$integration->getData('name')]['resource']); } else { $integration->setData('resource', $this->aclRetriever->getAllowedResourcesByUser(UserContextInterface::USER_TYPE_INTEGRATION, (int) $integration->getId())); } } }
/** * Add the list of allowed resources to the integration object data by 'resource' key. * * @param IntegrationModel $integration * @return void */ protected function _addAllowedResources(IntegrationModel $integration) { if ($integration->getId()) { if ($integration->getSetupType() == IntegrationModel::TYPE_CONFIG) { $integration->setData('resource', $this->getIntegrationApiResource($integration)); } else { $integration->setData('resource', $this->aclRetriever->getAllowedResourcesByUser(UserContextInterface::USER_TYPE_INTEGRATION, (int) $integration->getId())); } } }