You are here

function WorkbenchModerationWebTestCase::setup in Workbench Moderation 7.2

1 call to WorkbenchModerationWebTestCase::setup()
WorkbenchModerationNodeAccessTestCase::setup in tests/workbench_moderation.test
1 method overrides WorkbenchModerationWebTestCase::setup()
WorkbenchModerationNodeAccessTestCase::setup in tests/workbench_moderation.test

File

tests/workbench_moderation.test, line 12
workbench_moderation.test

Class

WorkbenchModerationWebTestCase
Tests for Workbench Moderation.

Code

function setup() {

  // Ensure we process passed in modules.
  $modules = func_get_args();
  if (isset($modules[0]) && is_array($modules[0])) {
    $modules = $modules[0];
  }
  $modules += array(
    'state_machine',
    'state_flow',
    'state_flow_entity',
    'workbench_moderation',
    'workbench_workflows',
    'views',
  );
  parent::setup($modules);

  // Install the basic workflow.
  module_load_include('inc', 'workbench_workflows', 'includes/workbench_workflows.starter');
  workbench_workflows_import_starter_exportables();

  // Ensure the just imported objects are known and not stuck in the cache.
  ctools_export_load_object_reset();

  // Ensure the new permissions introduced by the import are known.
  $this
    ->checkPermissions(array(), TRUE);
  $permissions = array(
    'administer nodes',
    'bypass node access',
    'use workbench_moderation my drafts tab',
    'use workbench_moderation needs review tab',
    'administer_workbench_workflows',
    'access administration pages',
    'administer site configuration',
    'administer content revisions',
  );
  $this->admin_user = $this
    ->drupalCreateUser($permissions);
  $this
    ->drupalLogin($this->admin_user);
}