public function ServicesWebTestCase::setUp in Services 7.3
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()
13 calls to ServicesWebTestCase::setUp()
- ServicesAliasTests::setUp in tests/
functional/ ServicesAliasTests.test - Sets up a Drupal site for running functional and integration tests.
- ServicesArgumentsTestCase::setUp in tests/
functional/ ServicesArgumentsTests.test - Sets up a Drupal site for running functional and integration tests.
- ServicesParserTests::setUp in tests/
functional/ ServicesParserTests.test - Sets up a Drupal site for running functional and integration tests.
- ServicesResourceCommentTests::setUp in tests/
functional/ ServicesResourceCommentTests.test - Sets up a Drupal site for running functional and integration tests.
- ServicesResourceDisabledTest::setUp in tests/
functional/ ServicesResourceDisabledTests.test - Sets up a Drupal site for running functional and integration tests.
13 methods override ServicesWebTestCase::setUp()
- ServicesAliasTests::setUp in tests/
functional/ ServicesAliasTests.test - Sets up a Drupal site for running functional and integration tests.
- ServicesArgumentsTestCase::setUp in tests/
functional/ ServicesArgumentsTests.test - Sets up a Drupal site for running functional and integration tests.
- ServicesParserTests::setUp in tests/
functional/ ServicesParserTests.test - Sets up a Drupal site for running functional and integration tests.
- ServicesResourceCommentTests::setUp in tests/
functional/ ServicesResourceCommentTests.test - Sets up a Drupal site for running functional and integration tests.
- ServicesResourceDisabledTest::setUp in tests/
functional/ ServicesResourceDisabledTests.test - Sets up a Drupal site for running functional and integration tests.
File
- tests/
services.test, line 8
Class
Code
public function setUp(array $modules = array()) {
// All tests will include the main dependencies.
$modules[] = 'ctools';
$modules[] = 'services';
// Use the REST server for most of the tests.
$modules[] = 'rest_server';
parent::setUp($modules);
// Use a cookie file, so login sessions will survive, even if we
// reinitialize Curl.
$this->cookieFile = drupal_tempnam(variable_get('file_temporary_path'), 'services_cookiejar');
// Load the cookie file when initializing Curl.
$this->additionalCurlOptions[CURLOPT_COOKIEFILE] = $this->cookieFile;
}