You are here

function VarnishTestCase::setUp in Varnish 6

Same name and namespace in other branches
  1. 7 varnish.test \VarnishTestCase::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 VarnishTestCase::setUp()
VarnishAdminTestCase::setUp in ./varnish.test
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.…
VarnishCacheInvalidationCase::setUp in ./varnish.test
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.…
2 methods override VarnishTestCase::setUp()
VarnishAdminTestCase::setUp in ./varnish.test
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.…
VarnishCacheInvalidationCase::setUp in ./varnish.test
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.…

File

./varnish.test, line 13
Tests the basic functionality of Varnish.

Class

VarnishTestCase
Base class for Varnish Test Cases.

Code

function setUp() {

  // Save off varnish settings, we will need to set these later
  // on in order to perform tests.
  if (!isset($this->varnish_config)) {
    $this->varnish_config = array(
      'varnish_control_key' => variable_get('varnish_control_key', ''),
      'varnish_control_terminal' => variable_get('varnish_control_terminal', '127.0.0.1:6082'),
      'varnish_version' => variable_get('varnish_version', 2.1),
      'varnish_socket_timeout' => variable_get('varnish_socket_timeout', VARNISH_DEFAULT_TIMETOUT),
      // We always want this to be set to default.
      'varnish_cache_clear' => VARNISH_DEFAULT_CLEAR,
    );
  }
  parent::setUp('varnish', 'comment');
  $this
    ->setUpVariables();
  $this
    ->setUpPermissions();
}