You are here

public function FacetapiSearchPageInterfaceTestCase::testFormAccess in Facet API 6.3

Same name and namespace in other branches
  1. 7.2 tests/facetapi.test \FacetapiSearchPageInterfaceTestCase::testFormAccess()
  2. 7 tests/facetapi.test \FacetapiSearchPageInterfaceTestCase::testFormAccess()

File

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

Class

FacetapiSearchPageInterfaceTestCase

Code

public function testFormAccess() {

  // @todo Implement API to enable facets.
  // @see http://drupal.org/node/1208326
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->enableFacet('enabled', t('Enabled facet'));
  $this
    ->drupalLogin($this->authenticatedUser);

  // @todo Randomize keys.
  // Tests breadcrumb trail when search keys are in the path.
  $path = 'facetapi_test/search/testkeys';
  $options = array(
    'query' => array(
      'f' => array(
        0 => 'enabled:testone',
      ),
    ),
  );
  $this
    ->drupalGet($path, $options);
  $this
    ->clickLink('testkeys');
  $this
    ->assertUrl($path);

  // Tests breadcrumb trail when search keys are in the query string.
  $path = 'facetapi_test/search';
  $options = array(
    'query' => array(
      'keys' => 'testkeys',
      'f' => array(
        0 => 'enabled:testone',
      ),
    ),
  );
  $this
    ->drupalGet($path, $options);
  $this
    ->clickLink('testkeys');
  $this
    ->assertUrl($path, array(
    'query' => array(
      'keys' => 'testkeys',
    ),
  ));
}