You are here

protected function SolrBackendTestBase::getSolrVersion in Search API Solr 8.2

Same name and namespace in other branches
  1. 8.3 tests/src/Kernel/SolrBackendTestBase.php \Drupal\Tests\search_api_solr\Kernel\SolrBackendTestBase::getSolrVersion()
  2. 4.x tests/src/Kernel/SolrBackendTestBase.php \Drupal\Tests\search_api_solr\Kernel\SolrBackendTestBase::getSolrVersion()

Throws

\Drupal\search_api\SearchApiException

1 call to SolrBackendTestBase::getSolrVersion()
SearchApiSolrLocationTest::testBackend in tests/src/Kernel/SearchApiSolrLocationTest.php
Tests location searches and distance facets.

File

tests/src/Kernel/SolrBackendTestBase.php, line 164

Class

SolrBackendTestBase
Tests location searches and distance facets using the Solr search backend.

Namespace

Drupal\Tests\search_api_solr\Kernel

Code

protected function getSolrVersion() {
  static $solr_version = FALSE;
  if (!$solr_version) {

    /** @var \Drupal\search_api_solr\SolrBackendInterface $backend */
    $backend = Server::load($this->serverId)
      ->getBackend();
    $connector = $backend
      ->getSolrConnector();
    $solr_version = $connector
      ->getSolrVersion();
  }
  return $solr_version;
}