You are here

public function StreamingExpressionTest::testStreamingExpressionBuilder in Search API Solr 8.2

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

Tests streaming expression builder.

File

tests/src/Kernel/StreamingExpressionTest.php, line 78

Class

StreamingExpressionTest
Provides tests for building streaming expressions.

Namespace

Drupal\Tests\search_api_solr\Kernel

Code

public function testStreamingExpressionBuilder() {
  $streaming_expression = $this->exp
    ->select($this->exp
    ->search($this->exp
    ->_collection(), 'q=' . $this->exp
    ->_field_escaped_value('search_api_datasource', 'entity:entity_test_mulrev_changed'), 'fq="' . $this->exp
    ->_index_filter_query() . '"', 'fl="' . $this->exp
    ->_field_list([
    'name',
    'body',
    'created',
  ]) . '"', 'sort="' . $this->exp
    ->_field('created') . ' DESC"', 'qt="/export"'), $this->exp
    ->_field_list([
    'name',
    'body',
  ]));
  $this
    ->assertEquals('select(search(d8, q=ss_search_api_datasource:entity\\:entity_test_mulrev_changed, fq="+index_id:server_prefixindex_prefixsolr_search_index +hash:' . Utility::getSiteHash() . '", fl="tm_name,tm_body,ds_created", sort="ds_created DESC", qt="/export"), tm_name,tm_body)', $streaming_expression);
}