public function testGetIntegrationsFromConfigReader()
 {
     $integrations = ['foo', 'bar', 'baz'];
     $this->configCacheTypeMock->expects($this->once())->method('load')->with(Config::CACHE_ID)->will($this->returnValue(null));
     $this->configCacheTypeMock->expects($this->once())->method('save')->with(serialize($integrations), Config::CACHE_ID, [Type::CACHE_TAG])->will($this->returnValue(null));
     $this->configReaderMock->expects($this->once())->method('read')->will($this->returnValue($integrations));
     $this->assertEquals($integrations, $this->configModel->getIntegrations());
 }
 /**
  * Check whether all indices are valid or not
  *
  * @return bool
  */
 public function isDisplayed()
 {
     foreach (array_keys($this->consolidatedConfig->getIntegrations()) as $name) {
         $integration = $this->integrationService->findByName($name);
         if ($integration->getStatus() == Integration::STATUS_RECREATED) {
             return true;
         }
     }
     return false;
 }
Пример #3
0
 /**
  * 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()));
         }
     }
 }
Пример #4
0
 /**
  * {@inheritdoc}
  */
 public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
 {
     $this->integrationManager->processConfigBasedIntegrations($this->integrationConfig->getIntegrations());
 }