public function FacetapiApiFunctions::testSetFacetStatus in Facet API 7
Same name and namespace in other branches
- 7.2 tests/facetapi.test \FacetapiApiFunctions::testSetFacetStatus()
Tests facetapi_set_facet_status() API functions.
See also
File
- tests/
facetapi.test, line 401 - Tests for the Facet API module.
Class
- FacetapiApiFunctions
- Test cases for low level API functions.
Code
public function testSetFacetStatus() {
list($facet, $realm, $adapter) = $this
->facetapiLoadObjects();
// Facet disabled by default, tests temporarily overriding status. Although
// the setting is disabled, status should be TRUE.
facetapi_set_facet_enabled('facetapi_test', 'nodisplay', 'enabled');
$enabled = facetapi_facet_enabled('facetapi_test', 'nodisplay', 'enabled');
$this
->assertTrue($enabled, t('Facet temporarily enabled by facetapi_set_facet_disabled().'), 'Facet API');
// Saves facet as enabled, tests temporarily overriding status. Although the
// setting is enabled, status should be FALSE.
facetapi_save_facet_enabled($adapter, $realm, $facet);
facetapi_set_facet_disabled('facetapi_test', 'nodisplay', 'enabled');
$enabled = facetapi_facet_enabled('facetapi_test', 'nodisplay', 'enabled');
$this
->assertFalse($enabled, t('Facet temporarily disabled by facetapi_set_facet_disabled().'), 'Facet API');
}