You are here

public function LinkBaseTestClass::setUp in Link 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()

8 calls to LinkBaseTestClass::setUp()
LinkConvertInternalPathsTest::setUp in tests/LinkConvertInternalPathsTest.test
Sets up a Drupal site for running functional and integration tests.
LinkEntityTokenTest::setUp in tests/LinkEntityTokenTest.test
Sets up a Drupal site for running functional and integration tests.
LinkFieldAttributesTest::setUp in tests/LinkFieldAttributesTest.test
Sets up a Drupal site for running functional and integration tests.
LinkFieldCrudTest::setUp in tests/LinkFieldCrudTest.test
Sets up a Drupal site for running functional and integration tests.
LinkPathPrefixesTest::setUp in tests/LinkPathPrefixesTest.test
Sets up a Drupal site for running functional and integration tests.

... See full list

8 methods override LinkBaseTestClass::setUp()
LinkConvertInternalPathsTest::setUp in tests/LinkConvertInternalPathsTest.test
Sets up a Drupal site for running functional and integration tests.
LinkEntityTokenTest::setUp in tests/LinkEntityTokenTest.test
Sets up a Drupal site for running functional and integration tests.
LinkFieldAttributesTest::setUp in tests/LinkFieldAttributesTest.test
Sets up a Drupal site for running functional and integration tests.
LinkFieldCrudTest::setUp in tests/LinkFieldCrudTest.test
Sets up a Drupal site for running functional and integration tests.
LinkPathPrefixesTest::setUp in tests/LinkPathPrefixesTest.test
Sets up a Drupal site for running functional and integration tests.

... See full list

File

tests/LinkBaseTestClass.test, line 33
Base test class with helper methods, etc.

Class

LinkBaseTestClass
Base test class with helper methods, etc.

Code

public function setUp(array $modules = array()) {

  // Most of the tests require the field UI to create & modify fields.
  $modules[] = 'field_ui';

  // This module.
  $modules[] = 'link';
  parent::setUp($modules);
  $this->web_user = $this
    ->drupalCreateUser($this->permissions);
  $this
    ->drupalLogin($this->web_user);
}