You are here

protected function SearchApiWebTest::searchNoResults in Search API 7

Asserts that a search on the index works but yields no results.

This is the case since no items should have been indexed yet.

1 call to SearchApiWebTest::searchNoResults()
SearchApiWebTest::testFramework in ./search_api.test
Tests correct admin UI, indexing and search behavior.

File

./search_api.test, line 351
Contains the SearchApiWebTest and the SearchApiUnitTest classes.

Class

SearchApiWebTest
Class for testing Search API functionality via the UI.

Code

protected function searchNoResults() {
  $results = $this
    ->doSearch();
  $this
    ->assertEqual($results['result count'], 0, 'No search results returned without indexing.');
  $this
    ->assertEqual(array_keys($results['results']), array(), 'No search results returned without indexing.');
}