You are here

public function SearchApiSolrTechproductsTest::testBackend in Search API Solr 8.2

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

Tests location searches and distance facets.

Overrides BackendTestBase::testBackend

File

tests/src/Kernel/SearchApiSolrTechproductsTest.php, line 56

Class

SearchApiSolrTechproductsTest
Tests the 'Any Schema' Solr search backend.

Namespace

Drupal\Tests\search_api_solr\Kernel

Code

public function testBackend() {

  /** @var \Drupal\search_api\Query\ResultSet $result */
  $query = $this
    ->buildSearch(NULL, [], NULL, FALSE)
    ->sort('search_api_id');
  $result = $query
    ->execute();
  $this
    ->assertEquals([
    "0579B002",
    "100-435805",
    "3007WFP",
    "6H500F0",
    "9885A004",
    "EN7800GTX/2DHTV/256M",
    "EUR",
    "F8V7067-APL-KIT",
    "GB18030TEST",
    "GBP",
  ], array_keys($result
    ->getResultItems()), 'Search for all tech products');
}