You are here

public function MobileToolsBrowscapTestCase::setUp in Mobile Tools 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()

File

mobile_tools_browscap/mobile_tools_browscap.test, line 33
Tests for mobile_tools_browscap

Class

MobileToolsBrowscapTestCase
Test the browscap integration with mobile tools

Code

public function setUp() {
  parent::setUp('mobile_tools_browscap');
  $this->admin_user = $this
    ->drupalCreateUser(array(
    'administer mobile tools',
  ));
  $this->device_group = array(
    'title' => 'Test Group',
    'dgid' => 'test_group',
    'purl_modifier' => 'test_modifier',
    'description' => 'Test device group.',
    'detector' => 'mobile_tools_browscap',
  );
  $this->edited_device_group = array(
    'title' => 'Renamed Test Group',
    'purl_modifier' => 'renamed_test_modifier',
    'description' => 'Renamed test device group.',
    'detector' => 'none',
  );
  $this->mainUrl = 'admin/config/system/mobile-tools';
  $this->settingsUrl = 'admin/config/system/mobile-tools/settings';
  $this->addUrl = 'admin/config/system/mobile-tools/add';
  $this->editUrl = 'admin/config/system/mobile-tools/edit';
  $this->deleteUrl = 'admin/config/system/mobile-tools/delete';
}