You are here

public function AcquiaAgentTestCase::setUp in Acquia Connector 7.3

Same name and namespace in other branches
  1. 7.2 acquia_agent/tests/acquia_agent.test \AcquiaAgentTestCase::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_agent/tests/acquia_agent.test, line 84
Tests the functionality of the Acquia Agent module.

Class

AcquiaAgentTestCase
AcquiaAgentTestCase.

Code

public function setUp() {
  global $base_url;

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

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

  // Create a user that has a Network subscription.
  $this->networkUser = $this
    ->drupalCreateUser();
  user_save($this->networkUser, array(
    'mail' => ACQUIA_CONNECTOR_TEST_EMAIL,
    'pass' => ACQUIA_CONNECTOR_TEST_PASS,
  ));

  // Setup variables.
  $this->setupPath = 'admin/config/system/acquia-agent/setup';
  $this->credentialsPath = 'admin/config/system/acquia-agent/credentials';
  $this->settingsPath = 'admin/config/system/acquia-agent';
  $this->helpPath = 'admin/help/acquia_agent';
  $this->cloudFreeUrl = 'https://www.acquia.com/acquia-cloud-free';
  $this->statusReportUrl = '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);
}