You are here

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

Tests Acquia Dev hosting environment and search v3 core detected.

Configs point to the index on the Dev environment and host pointing to search v3.

File

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

Class

AcquiaSearchOverrideTest
Tests for Acquia Search override cores.

Namespace

Drupal\Tests\acquia_search\Kernel

Code

public function testAcquiaSearchV3CoreDetected() {
  $_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
    ->assertEquals('sr-dev.acquia.com', $config['host']);
  $this
    ->assertGetUpdateQueryNoException($solr_connector);
}