You are here

protected function AcquiaConnectorSearchOverrideTest::connect in Acquia Connector 8

Connect to the Acquia Subscription.

1 call to AcquiaConnectorSearchOverrideTest::connect()
AcquiaConnectorSearchOverrideTest::setUp in acquia_search/tests/src/Functional/AcquiaConnectorSearchOverrideTest.php

File

acquia_search/tests/src/Functional/AcquiaConnectorSearchOverrideTest.php, line 268

Class

AcquiaConnectorSearchOverrideTest
Tests the automatic switching behavior of the Acquia Search module.

Namespace

Drupal\Tests\acquia_search\Functional

Code

protected function connect() {
  \Drupal::configFactory()
    ->getEditable('acquia_connector.settings')
    ->set('spi.ssl_verify', FALSE)
    ->save();
  \Drupal::configFactory()
    ->getEditable('acquia_connector.settings')
    ->set('spi.ssl_override', TRUE)
    ->save();
  \Drupal::configFactory()
    ->getEditable('acquia_connector.settings')
    ->set('spi.server', 'http://mock-spi-server')
    ->save();
  $admin_user = $this
    ->createAdminUser();
  $this
    ->drupalLogin($admin_user);
  $edit_fields = [
    'acquia_identifier' => $this->id,
    'acquia_key' => $this->key,
  ];
  $submit_button = 'Connect';
  $this
    ->drupalPostForm('admin/config/system/acquia-connector/credentials', $edit_fields, $submit_button);
  \Drupal::service('module_installer')
    ->install([
    'acquia_search',
  ]);
}