You are here

function NameTestHelper::setUp in Name Field 6

Same name and namespace in other branches
  1. 7 tests/name.test \NameTestHelper::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

File

tests/name.test, line 12
Tests for the name module.

Class

NameTestHelper
Helper test class with some added functions for testing.

Code

function setUp() {

  // Call parent::setUp() allowing test cases to pass further modules.
  $modules = func_get_args();
  $modules = array_merge(array(
    'content',
    'name',
  ), $modules);
  $parent_callback = 'parent::setUp';
  if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    $parent_callback = array(
      $this,
      'parent::setUp',
    );
  }
  call_user_func_array($parent_callback, $modules);
}