You are here

function SimpleNewsSchedulerWebTestCase::setUp in Simplenews Scheduler 6.2

Same name and namespace in other branches
  1. 7 tests/simplenews_scheduler.test \SimpleNewsSchedulerWebTestCase::setUp()

Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix. A temporary files directory is created with the same name as the database prefix.

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

2 calls to SimpleNewsSchedulerWebTestCase::setUp()
SimpleNewsSchedulerEditionDueTest::setUp in tests/simplenews_scheduler.test
Declares the module dependencies and create data for the test.
SimpleNewsSchedulerNodeCreationTest::setUp in tests/simplenews_scheduler.test
Declares the module dependencies for the test.
2 methods override SimpleNewsSchedulerWebTestCase::setUp()
SimpleNewsSchedulerEditionDueTest::setUp in tests/simplenews_scheduler.test
Declares the module dependencies and create data for the test.
SimpleNewsSchedulerNodeCreationTest::setUp in tests/simplenews_scheduler.test
Declares the module dependencies for the test.

File

tests/simplenews_scheduler.test, line 18
Tests for Simplenews Scheduler.

Class

SimpleNewsSchedulerWebTestCase
Class with common setup.

Code

function setUp() {

  // setUp() expects a list rather than an array, and we can't use
  // call_user_func_array() with parent:: without mucking about with checking
  // whether we're on PHP 5.2 or 5.3.
  // Hence for now the module list is fixed for all our tests.
  // @todo: figure out why we need content module to not crash tests!?!
  parent::setUp('content', 'simplenews', 'token', 'date_api', 'date', 'simplenews_scheduler');

  // Use a timezone for testing that is visibly different from UTC, and which
  // has daylight saving changes.
  $this->site_timezone_name = 'Europe/Kiev';
  $this->site_timezone_object = timezone_open($this->site_timezone_name);

  // Set the site timezone.
  variable_set('date_default_timezone_name', $this->site_timezone_name);

  // Note that there's no point in setting 'date_default_timezone' here
  // because it's stored as a fixed offset in seconds from UTC, and so doesn't
  // take daylight saving time changes in to account!
  // Workaround for D6 not setting the PHP local timezone.
  date_default_timezone_set($this->site_timezone_name);
}