You are here

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

Tests environment detection without cores available.

Acquia Test environment and a DB name. According to the mock, no cores available for the Test environment so it is read only.

File

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

Class

AcquiaSearchOverrideTest
Tests for Acquia Search override cores.

Namespace

Drupal\Tests\acquia_search\Kernel

Code

public function testAcquiaHostingEnvironmentDetectedNoAvailableCores() {
  $_ENV['AH_SITE_ENVIRONMENT'] = 'test';
  $_ENV['AH_SITE_NAME'] = 'testsite1test';
  $_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();
  $this
    ->assertEquals(ACQUIA_SEARCH_AUTO_OVERRIDE_READ_ONLY, $config['overridden_by_acquia_search']);
  $this
    ->assertGetUpdateQueryException($solr_connector);
}