You are here

function DrupalSolrMatchTestCase::_testQueryMatching in Apache Solr Search 6

Same name and namespace in other branches
  1. 8 tests/solr_index_and_search.test \DrupalSolrMatchTestCase::_testQueryMatching()
  2. 6.3 tests/solr_index_and_search.test \DrupalSolrMatchTestCase::_testQueryMatching()
  3. 6.2 tests/solr_index_and_search.test \DrupalSolrMatchTestCase::_testQueryMatching()
  4. 7 tests/solr_index_and_search.test \DrupalSolrMatchTestCase::_testQueryMatching()

Test the matching abilities of the engine.

Verify if a query produces the correct results.

1 call to DrupalSolrMatchTestCase::_testQueryMatching()
DrupalSolrMatchTestCase::_testQueries in tests/solr_index_and_search.test
Run predefine queries looking for indexed terms.

File

tests/solr_index_and_search.test, line 166
Tests for the apachsolr module: index and search.

Class

DrupalSolrMatchTestCase
@file Tests for the apachsolr module: index and search.

Code

function _testQueryMatching($query, $set, $results) {

  // Get result IDs.
  $found = array();
  foreach ($set as $item) {
    $found[] = $item->nid;
  }

  // Compare $results and $found.
  sort($found);
  sort($results);
  $this
    ->assertEqual($found, $results, "Query matching '{$query}'");
}