function SearchMatchTestCase::_testQueryMatching
Test the matching abilities of the engine.
Verify if a query produces the correct results.
1 call to SearchMatchTestCase::_testQueryMatching()
- SearchMatchTestCase::_testQueries in modules/
search/ search.test - Run predefine queries looking for indexed terms.
File
-
modules/
search/ search.test, line 211
Class
- SearchMatchTestCase
- Indexes content and queries it.
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}'");
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.