You are here

public function AcquiaSearchV3ApiClientTest::testSearchV3ApiCall in Acquia Connector 8

Tests call to search v3 api.

File

acquia_search/tests/src/Unit/AcquiaSearchV3ApiClientTest.php, line 85

Class

AcquiaSearchV3ApiClientTest
Search v3 Client test.

Namespace

Drupal\Tests\acquia_search\Unit

Code

public function testSearchV3ApiCall() {
  $expected = [
    [
      'balancer' => 'test.sr-dev.acquia.com',
      'core_id' => 'WXYZ-12345.dev.drupal8',
      'version' => 'v3',
    ],
  ];
  $client = new AcquiaSearchV3ApiClient($this->searchV3Host, $this->searchV3ApiKey, $this->guzzleClient
    ->reveal(), $this->cacheBackend
    ->reveal());
  $this
    ->assertEquals($expected, $client
    ->getSearchV3Indexes('WXYZ-12345'));
  $this->cacheBackend
    ->set('acquia_search.v3indexes', $expected, time() + 24 * 60 * 60)
    ->shouldHaveBeenCalledTimes(1);
}