You are here

public function BEF_TestCase::testsimpletest_befPageDisplayCheckboxes in Better Exposed Filters 7

Same name and namespace in other branches
  1. 8.3 tests/better_exposed_filters.test \BEF_TestCase::testsimpletest_befPageDisplayCheckboxes()
  2. 6.3 tests/better_exposed_filters.test \BEF_TestCase::testsimpletest_befPageDisplayCheckboxes()
  3. 6 tests/better_exposed_filters.test \BEF_TestCase::testsimpletest_befPageDisplayCheckboxes()
  4. 6.2 tests/better_exposed_filters.test \BEF_TestCase::testsimpletest_befPageDisplayCheckboxes()

Verify that checkboxes are rendered correctly on a page display

File

tests/better_exposed_filters.test, line 167
Tests for the Better Exposed Filters module @author mikeker

Class

BEF_TestCase
Functional test for Better Exposed Filters

Code

public function testsimpletest_befPageDisplayCheckboxes() {

  // Exposed the type filter such that it allows multiple selections
  $bef_settings = array(
    'bef_format' => 'bef',
    'bef_filter_description' => $this
      ->randomName(16),
    'bef_select_all_none' => TRUE,
    'single' => FALSE,
  );
  $this
    ->_befExposedFilterSettings('type', $bef_settings);

  // Add a page view to the default view
  $settings = array(
    'path' => array(
      'path' => $this
        ->randomName(8),
    ),
  );
  $this
    ->_befCreateDisplay('page', $settings);
  $this
    ->_befSaveView();
  $this
    ->drupalGet($settings['path']['path']);
  $this
    ->assertText(t('Node: Type'), 'Verify exposed filter label', 'Better Exposed Filters');
  $this
    ->assertFieldByXpath('//input[@name="type[]" and @type="checkbox"]', NULL, 'Exposed filter is shown as checkboxes', 'Better Exposed Filters');
  $this
    ->assertFieldByXpath('//div[contains(@class, "bef-select-all-none")]', NULL, 'Class is set correctly for JS to build select all/none links', 'Beter Exposed Filters');
}