You are here

public function PatternsSystemTestCase::testForms in Patterns 7.2

Same name and namespace in other branches
  1. 7 tests/system/system.test \PatternsSystemTestCase::testForms()

File

tests/system/system.test, line 75
SimpleTests for the System component of Patterns.

Class

PatternsSystemTestCase
@file SimpleTests for the System component of Patterns.

Code

public function testForms() {

  // Check for variables before running the pattern.
  $this
    ->assertIdentical(variable_get('cache', NULL), NULL, t('cache variable should not be set.'));
  $this
    ->assertIdentical(variable_get('anonymous', NULL), NULL, t("anonymous variable should not be set."));

  // Run the pattern.
  parent::runFile('fill_forms.yaml', 'Fill in values for forms', $this->system_tests_dir);

  // Expected messages.
  $this
    ->assertText(t('The configuration options have been saved.'), t('The forms have been submitted.'));

  // Check for variables after running the pattern.
  $this
    ->assertIdentical(variable_get('cache', NULL), 1, t('cache variable should be 1.'));
  $this
    ->assertIdentical(variable_get('anonymous', NULL), 'Anonymous2', t("Anonymous variable should be 'Anonymous2'."));
}