You are here

public function MessageUiHardCodedArguments::setUp in Message UI 7

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

./message_ui.test, line 164

Class

MessageUiHardCodedArguments
Testing the editing of the hard coded arguments.

Code

public function setUp() {
  parent::setUp('message', 'message_ui', 'entity_token');
  $message_type = message_type_create('dummy_message', array(
    'message_text' => array(
      LANGUAGE_NONE => array(
        array(
          'value' => '@{message:user:name}.',
        ),
      ),
    ),
  ));
  $message_type
    ->save();
  $this->user1 = $this
    ->drupalCreateUser();
  $this->user2 = $this
    ->drupalCreateUser();
  $role = user_role_load_by_name('authenticated user');
  user_role_grant_permissions($role->rid, array(
    'bypass message access control',
  ));
}