You are here

public function ConfigurationWebTestCase::setUp in Configuration Management 7

Same name and namespace in other branches
  1. 7.2 tests/configuration.test \ConfigurationWebTestCase::setUp()

Implementation of DrupalWebTestCase::setUp().

Overrides DrupalWebTestCase::setUp

4 calls to ConfigurationWebTestCase::setUp()
ConfigurationActiveStoreOverriddenTest::setUp in tests/configuration.test
Set up test.
ConfigurationContribWebTestCase::setUp in tests/configuration.contrib.test
Set up test.
ConfigurationTrackingTest::setUp in tests/configuration.test
Set up test.
ConfigurationUITest::setUp in tests/configuration.test
Set up test.
4 methods override ConfigurationWebTestCase::setUp()
ConfigurationActiveStoreOverriddenTest::setUp in tests/configuration.test
Set up test.
ConfigurationContribWebTestCase::setUp in tests/configuration.contrib.test
Set up test.
ConfigurationTrackingTest::setUp in tests/configuration.test
Set up test.
ConfigurationUITest::setUp in tests/configuration.test
Set up test.

File

tests/configuration.test, line 99
Tests for Configuration Management

Class

ConfigurationWebTestCase
Base class for functional tests for configuration management.

Code

public function setUp($modules = array()) {
  parent::setUp($modules);
  $this->configuration_needs_saving_text = t('Configurations are out of sync and need to be either !write.', array(
    '!write' => l(t('activated or written to file'), 'admin/config/system/configuration/tracking'),
  ));

  // Generate an unique path for this test based on the database prefix.
  $this->datastore_path = file_directory_temp();
  variable_set('configuration_config_path', $this->datastore_path);
  $this
    ->verbose('Saving configurations into: ' . $this->datastore_path);
  file_prepare_directory(variable_get('configuration_config_path', $this->datastore_path));

  // Reset the admin user for each test.
  $this->adminUser = NULL;

  // Use the administration interface so config:// is correctly set up.
  $this
    ->adminLogin();
  $edit = array();
  $edit["configuration_config_path"] = $this->datastore_path;
  $this
    ->drupalPost('admin/config/system/configuration/settings', $edit, t('Save configuration'));
  $this
    ->drupalLogout();
}