You are here

function simpletest_settings_form in SimpleTest 7.2

Same name and namespace in other branches
  1. 6.2 simpletest.pages.inc \simpletest_settings_form()
  2. 7 simpletest.pages.inc \simpletest_settings_form()

Provides settings form for SimpleTest variables.

1 string reference to 'simpletest_settings_form'
simpletest_menu in ./simpletest.module
Implements hook_menu().

File

./simpletest.pages.inc, line 454
Page callbacks for simpletest module.

Code

function simpletest_settings_form($form, &$form_state) {
  $form['general'] = array(
    '#type' => 'fieldset',
    '#title' => t('General'),
  );
  $form['general']['simpletest_clear_results'] = array(
    '#type' => 'checkbox',
    '#title' => t('Clear results after each complete test suite run'),
    '#description' => t('By default SimpleTest will clear the results after they have been viewed on the results page, but in some cases it may be useful to leave the results in the database. The results can then be viewed at <em>admin/config/development/testing/[test_id]</em>. The test ID can be found in the database, simpletest table, or kept track of when viewing the results the first time. Additionally, some modules may provide more analysis or features that require this setting to be disabled.'),
    '#default_value' => variable_get('simpletest_clear_results', TRUE),
  );
  $form['general']['simpletest_remove_tables'] = array(
    '#type' => 'checkbox',
    '#title' => t('Remove prefixed tables after each complete test suite run'),
    '#description' => t('By default SimpleTest will remove the prefixed tables created during testing, but in some cases it may be useful to leave the tables in the database.'),
    '#default_value' => variable_get('simpletest_remove_tables', TRUE),
  );
  $form['general']['simpletest_verbose'] = array(
    '#type' => 'checkbox',
    '#title' => t('Provide verbose information when running tests'),
    '#description' => t('The verbose data will be printed along with the standard assertions and is useful for debugging. The verbose data will be erased between each test suite run. The verbose data output is very detailed and should only be used when debugging.'),
    '#default_value' => variable_get('simpletest_verbose', TRUE),
  );
  $form['httpauth'] = array(
    '#type' => 'fieldset',
    '#title' => t('HTTP authentication'),
    '#description' => t('HTTP auth settings to be used by the SimpleTest browser during testing. Useful when the site requires basic HTTP authentication.'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['httpauth']['simpletest_httpauth_method'] = array(
    '#type' => 'select',
    '#title' => t('Method'),
    '#options' => array(
      CURLAUTH_BASIC => t('Basic'),
      CURLAUTH_DIGEST => t('Digest'),
      CURLAUTH_GSSNEGOTIATE => t('GSS negotiate'),
      CURLAUTH_NTLM => t('NTLM'),
      CURLAUTH_ANY => t('Any'),
      CURLAUTH_ANYSAFE => t('Any safe'),
    ),
    '#default_value' => variable_get('simpletest_httpauth_method', CURLAUTH_BASIC),
  );
  $form['httpauth']['simpletest_httpauth_username'] = array(
    '#type' => 'textfield',
    '#title' => t('Username'),
    '#default_value' => variable_get('simpletest_httpauth_username', ''),
  );
  $form['httpauth']['simpletest_httpauth_password'] = array(
    '#type' => 'textfield',
    '#title' => t('Password'),
    '#default_value' => variable_get('simpletest_httpauth_password', ''),
  );
  $form['remote'] = array(
    '#type' => 'fieldset',
    '#title' => t('Remote'),
    '#description' => t('Settings related to remote testing.'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['remote']['simpletest_remote_url'] = array(
    '#type' => 'textfield',
    '#title' => t('URL'),
    '#description' => t('Remote URL to perform testing against, leave blank for local url.'),
    '#default_value' => variable_get('simpletest_remote_url', ''),
  );
  return system_settings_form($form);
}