You are here

protected function AcquiaContentHubAdminSettingsTrait::createAcquiaContentHubAdminSettings in Acquia Content Hub 8.2

Get Acquia Content Hub settings.

Parameters

array $settings: Content Hub settings.

2 calls to AcquiaContentHubAdminSettingsTrait::createAcquiaContentHubAdminSettings()
ClientFactoryTest::testGetClientConfiguredByCoreConfig in tests/src/Kernel/ClientFactoryTest.php
Test case when content hub configured via core config or UI.
ImportUpdateAssetsTest::testOnHandleWebhookWithAutoUpdateDisabledEntityStatus in tests/src/Kernel/ImportUpdateAssetsTest.php
@covers ::onHandleWebhook

File

tests/src/Kernel/Traits/AcquiaContentHubAdminSettingsTrait.php, line 16

Class

AcquiaContentHubAdminSettingsTrait
Trait for ACH admin settings configurations.

Namespace

Drupal\Tests\acquia_contenthub\Kernel\Traits

Code

protected function createAcquiaContentHubAdminSettings(array $settings = []) : void {
  $default_settings = [
    'client_name' => 'test-client',
    'origin' => '00000000-0000-0001-0000-123456789123',
    'api_key' => '12312321312321',
    'secret_key' => '12312321312321',
    'hostname' => 'https://dev.content-hub.dev',
    'shared_secret' => '12312321312321',
    'event_service_url' => 'http://example.com',
  ];
  $actual_settings = array_merge($default_settings, $settings);
  $admin_settings = \Drupal::configFactory()
    ->getEditable('acquia_contenthub.admin_settings');
  $admin_settings
    ->setData($actual_settings)
    ->save();
}