function SearchMatchTest::_testQueryMatching

Test the matching abilities of the engine.

Verify if a query produces the correct results.

1 call to SearchMatchTest::_testQueryMatching()
SearchMatchTest::_testQueries in drupal/core/modules/search/lib/Drupal/search/Tests/SearchMatchTest.php
Run predefine queries looking for indexed terms.

File

drupal/core/modules/search/lib/Drupal/search/Tests/SearchMatchTest.php, line 203
Definition of Drupal\search\Tests\SearchMatchTest.

Class

SearchMatchTest

Namespace

Drupal\search\Tests

Code

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

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

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