function SearchMatchTest::_testQueryMatching in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/search/src/Tests/SearchMatchTest.php \Drupal\search\Tests\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 core/
modules/ search/ src/ Tests/ SearchMatchTest.php - Run predefine queries looking for indexed terms.
File
- core/
modules/ search/ src/ Tests/ SearchMatchTest.php, line 226 - Contains \Drupal\search\Tests\SearchMatchTest.
Class
- SearchMatchTest
- Indexes content and queries it.
Namespace
Drupal\search\TestsCode
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}'");
}