You are here

public function FacetapiSearchPageInterfaceTestCase::testFormAccess in Facet API 7

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

File

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

Class

FacetapiSearchPageInterfaceTestCase

Code

public function testFormAccess() {

  // Enable facet and position block.
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->facetapiEnableFacet();
  $this
    ->facetapiEnableFacetBlock();

  // Logs in as a normal user.
  $this
    ->drupalLogin($this->authenticatedUser);

  // 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',
    ),
  ));
}