You are here

function RelationMigrateTestCase::setUp in Relation 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 RelationTestCase::setUp

See also

DrupalWebTestCase::prepareDatabasePrefix()

DrupalWebTestCase::changeDatabasePrefix()

DrupalWebTestCase::prepareEnvironment()

File

relation_migrate/tests/relation.migrate.test, line 20
Test case that tests relation_migrate.module.

Class

RelationMigrateTestCase
Functional tests of Relation's integration with Migrate.

Code

function setUp() {

  // Entity reference complains if views not enabled.
  parent::setUp('relation');
  module_enable(array(
    'migrate_ui',
    'relation_migrate_test',
    'relation_migrate',
  ), TRUE);
  $this
    ->resetAll();
  if (!module_exists('migrate') || !module_exists('migrate_ui') || !module_exists('node_reference') || !module_exists('user_reference') || !module_exists('entityreference')) {
    return;
  }
  $permissions = array(
    'create article content',
    'create page content',
    'administer relation types',
    'administer relations',
    'access relations',
    'create relations',
    'edit relations',
    'delete relations',
    'administer content types',
    'migration information',
  );
  $this->web_user = $this
    ->drupalCreateUser($permissions);
  $this
    ->createNodes();
  $this->anonymous_user = $this
    ->drupalCreateUser(array(
    'access content',
  ));
}