You are here

public function AgreementTestCase::setUp in Agreement 7.2

Same name and namespace in other branches
  1. 6.2 agreement.test \AgreementTestCase::setUp()
  2. 6 agreement.test \AgreementTestCase::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()

1 call to AgreementTestCase::setUp()
AgreementMultipleRoleTestCase::setUp in ./agreement.test
Sets up a Drupal site for running functional and integration tests.
1 method overrides AgreementTestCase::setUp()
AgreementMultipleRoleTestCase::setUp in ./agreement.test
Sets up a Drupal site for running functional and integration tests.

File

./agreement.test, line 26
Tests for Agreement module.

Class

AgreementTestCase
Agreement base test class.

Code

public function setUp() {
  parent::setUp('agreement');
  $this->siteName = ' | ' . variable_get('siteName', 'Drupal');
  $this->pageTitle = $this
    ->randomName(16);
  $this->pageText = $this
    ->randomName(16);
  $this->notSet = $this
    ->randomName(32);

  // Make a node with a title that is distinguishable when manually debugging
  // tests.
  $this->node = $this
    ->drupalCreateNode(array(
    'title' => 'Node Page ' . $this
      ->randomName(8),
  ));
  $this->agreement = agreement_type_load('default');
  $settings = array(
    "settings[title]" => $this->pageTitle,
    "agreement[value]" => $this->pageText,
    "settings[visibility_settings]" => 0,
    "settings[visibility_pages]" => "<front>",
  );
  $this
    ->privilegedUserLogin();
  $this
    ->configureAgreementSettings($settings);
  $this->agreement = agreement_type_load('default', FALSE);
}