You are here

protected function SearchApiSolrTechproductsTest::firstSearch in Search API Solr 8.3

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

Executes a test search on the Solr server and assert the response data.

2 calls to SearchApiSolrTechproductsTest::firstSearch()
SearchApiSolrTechproductsTest::testBackend in tests/src/Kernel/SearchApiSolrTechproductsTest.php
Tests location searches and distance facets.
SearchApiSolrTechproductsTest::testStreamingExpressions in tests/src/Kernel/SearchApiSolrTechproductsTest.php

File

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

Class

SearchApiSolrTechproductsTest
Tests the document datasources using the solr techproducts example.

Namespace

Drupal\Tests\search_api_solr\Kernel

Code

protected function firstSearch() {

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