You are here

public function FacetapiApiFunctions::testActiveSearcher in Facet API 7

Same name and namespace in other branches
  1. 7.2 tests/facetapi.test \FacetapiApiFunctions::testActiveSearcher()

Tests the facetapi_*_active_searcher() functions.

See also

facetapi_add_active_searcher().

facetapi_is_active_searcher().

File

tests/facetapi.test, line 441
Tests for the Facet API module.

Class

FacetapiApiFunctions
Test cases for low level API functions.

Code

public function testActiveSearcher() {

  // Searcher is not active by default, test that context is FALSE.
  $active = facetapi_is_active_searcher('facetapi_test');
  $this
    ->assertFalse($active, t('Searcher correctly identified as inactive.'), 'Facet API');

  // Sets active searcher, test that context is TRUE.
  facetapi_add_active_searcher('facetapi_test');
  $active = facetapi_is_active_searcher('facetapi_test');
  $this
    ->assertTrue($active, t('Searcher correctly identified as active.'), 'Facet API');
}