You are here

public function AcquiaSPITestCase::setUp in Acquia Connector 7.2

Same name and namespace in other branches
  1. 7.3 acquia_spi/tests/acquia_spi.test \AcquiaSPITestCase::setUp()

Sets up a Drupal site for running functional and integration tests.

Generates a random database prefix and installs Drupal with the specified installation profile in DrupalWebTestCase::$profile into the prefixed database. Afterwards, installs any additional modules specified by the test.

After installation all caches are flushed and several configuration values are reset to the values of the parent site executing the test, since the default values may be incompatible with the environment in which tests are being executed.

Parameters

...: List of modules to enable for the duration of the test. This can be either a single array or a variable number of string arguments.

Overrides DrupalWebTestCase::setUp

See also

DrupalWebTestCase::prepareDatabasePrefix()

DrupalWebTestCase::changeDatabasePrefix()

DrupalWebTestCase::prepareEnvironment()

File

acquia_spi/tests/acquia_spi.test, line 49

Class

AcquiaSPITestCase
Tests the functionality of the Acquia SPI module.

Code

public function setUp() {
  global $base_url;

  // Enable any modules required for the test
  parent::setUp('acquia_agent', 'acquia_spi', 'acquia_connector_test');

  // Create and log in our privileged user.
  $this->privileged_user = $this
    ->drupalCreateUser(array(
    'administer site configuration',
    'access administration pages',
  ));
  $this
    ->drupalLogin($this->privileged_user);

  // Setup variables.
  $this->credentials_path = 'admin/config/system/acquia-agent/credentials';
  $this->settings_path = 'admin/config/system/acquia-agent';
  $this->status_report_url = 'admin/reports/status';
  variable_set('acquia_network_address', $base_url);
  variable_set('acquia_spi_server', $base_url);
  variable_set('acquia_spi_ssl_override', TRUE);
  variable_set('acquia_agent_verify_peer', FALSE);
}