You are here

public function AcquiaSearchOverrideTest::testAcquiaHostingEnvironmentDetected in Acquia Search 2.x

Tests Acquia Dev hosting environment detected.

Configs point to the index on the Dev environment.

File

tests/src/Kernel/AcquiaSearchOverrideTest.php, line 75

Class

AcquiaSearchOverrideTest
Tests for Acquia Search override cores.

Namespace

Drupal\Tests\acquia_search\Kernel

Code

public function testAcquiaHostingEnvironmentDetected() {
  $_ENV['AH_SITE_ENVIRONMENT'] = 'dev';
  $_ENV['AH_SITE_NAME'] = 'testsite1dev';
  $_ENV['AH_SITE_GROUP'] = 'testsite1';
  $this
    ->setAvailableSearchCores();
  $connector_plugin = new SearchApiSolrAcquiaConnector([], 'foo', [
    'foo',
  ]);
  $solr_connector = $connector_plugin
    ->create($this->container, [], 'foo', [
    'foo',
  ]);
  $config = $solr_connector
    ->defaultConfiguration();
  $db_name = $this
    ->getDbName();
  $this
    ->assertEquals(ACQUIA_SEARCH_OVERRIDE_AUTO_SET, $config['overridden_by_acquia_search']);
  $this
    ->assertEquals('WXYZ-12345.dev.' . $db_name, $config['index_id']);
  $this
    ->assertGetUpdateQueryNoException($solr_connector);
}