You are here

public function FacetapiAdminInterfaceTestCase::testEnableFacet in Facet API 7

Same name and namespace in other branches
  1. 6.3 tests/facetapi.test \FacetapiAdminInterfaceTestCase::testEnableFacet()
  2. 7.2 tests/facetapi.test \FacetapiAdminInterfaceTestCase::testEnableFacet()

Tests enabling a facet via the UI.

File

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

Class

FacetapiAdminInterfaceTestCase
Test cases for operations taken through the admin UI.

Code

public function testEnableFacet() {
  list($facet) = $this
    ->facetapiLoadObjects();

  // Enable the "enabled" facet and block via UI.
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->facetapiEnableFacet();
  $this
    ->facetapiEnableFacetBlock();

  // Test that block is positioned on the search page.
  $this
    ->drupalLogin($this->authenticatedUser);
  $this
    ->drupalGet('facetapi_test/search');
  $raw = t('Filter by @title:', array(
    '@title' => drupal_strtolower($facet['label']),
  ));
  $this
    ->assertRaw($raw, t('Facet block displayed on search page.'), 'Facet API');
}