You are here

function SearchMatchTest::_test_query_matching in SimpleTest 5

Same name and namespace in other branches
  1. 6 tests/search_match.test \SearchMatchTest::_test_query_matching()

Test the matching abilities of the engine.

Verify if a query produces the correct results.

1 call to SearchMatchTest::_test_query_matching()
SearchMatchTest::_test_queries in tests/search_match.test

File

tests/search_match.test, line 135

Class

SearchMatchTest

Code

function _test_query_matching($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}'");
}