You are here

protected function DeployWebTestCase::setUp in Deploy - Content Staging 7.3

Same name and namespace in other branches
  1. 7.2 deploy.test \DeployWebTestCase::setUp()

Set up all sites.

For some tests we don't need the multisite environment, but still want to use common methods in this test case.

Overrides DrupalWebTestCase::setUp

File

./deploy.test, line 28
Deployment tests.

Class

DeployWebTestCase
Helper class.

Code

protected function setUp($simple = FALSE) {
  $this->profile = 'standard';
  if ($simple) {
    parent::setUp('entity', 'deploy');
    return;
  }

  // Set up our origin site.
  $this
    ->setUpSite('deploy_origin', $this->origin_modules);

  // Switch back to original site to be able to set up a new site.
  $this
    ->switchSite('deploy_origin', 'simpletest_original_default');

  // Set up one endpoint site.
  $this
    ->setUpSite('deploy_endpoint', $this->endpoint_modules);

  // This is the user that will be used to authenticate the deployment between
  // the site. We add it to $GLOBALS so we can access the user info on the
  // origin site and configure the endpoint object with its username and
  // password.
  $GLOBALS['endpoint_user'] = $this
    ->drupalCreateUser(array(
    'access content',
    'create article content',
    'edit any article content',
    'administer users',
    'administer taxonomy',
  ));

  // Switch back to origin site where we want to start.
  $this
    ->switchSite('deploy_endpoint', 'deploy_origin');

  // Edit an endpoint object to point to our endpoint site.
  $this
    ->editEndpoint('deploy_example_endpoint', 'deploy_endpoint');
}