You are here

function FieldsetHelperTestCase::setFieldsetHelperStateManagerCookie in Fieldset helper 6

Resets the Fieldset helper state manager cookies value for every loaded fieldset.

2 calls to FieldsetHelperTestCase::setFieldsetHelperStateManagerCookie()
FieldsetHelperTestCase::testFieldsetHelperStateManagerCollapsed in ./fieldset_helper.test
Test that all fieldsets are collapsed.
FieldsetHelperTestCase::testFieldsetHelperStateManagerExpanded in ./fieldset_helper.test
Test that all fieldsets are expanded.

File

./fieldset_helper.test, line 144

Class

FieldsetHelperTestCase

Code

function setFieldsetHelperStateManagerCookie($state) {

  // Get lookup id for cookie generation.
  $lookup_id_table = fieldset_helper_state_manager_get_lookup_id();

  // Set the cookie state for all fieldsets for the current (test) page.
  foreach ($lookup_id_table as $key => $value) {
    $states[] = $value . '.' . $state;
  }
  $_COOKIE['fieldset_helper_state_manager'] = implode('_', $states);

  // Flush cached cookie states
  fieldset_helper_state_manager_get_cookie_states(TRUE);
}