You are here

public function ProtectedNodeBaseTestCase::setUp in Protected Node 7

Same name and namespace in other branches
  1. 1.0.x tests/protected_node.test \ProtectedNodeBaseTestCase::setUp()

Prepare users for protected node's tests.

Overrides DrupalWebTestCase::setUp

12 calls to ProtectedNodeBaseTestCase::setUp()
ProtectedNodeBulkPassword::setUp in tests/protected_node.bulk.test
Prepare users for protected node's tests.
ProtectedNodeFieldCollection::setUp in tests/protected_node.field_collection.test
Prepare users for protected node's tests.
ProtectedNodeFork::setUp in tests/protected_node.fork.test
Prepare users for protected node's tests.
ProtectedNodeGlobalPassword::setUp in tests/protected_node.global.test
Prepare users for protected node's tests.
ProtectedNodeMail::setUp in tests/protected_node.mail_test.test
Prepare users for protected node's tests.

... See full list

12 methods override ProtectedNodeBaseTestCase::setUp()
ProtectedNodeBulkPassword::setUp in tests/protected_node.bulk.test
Prepare users for protected node's tests.
ProtectedNodeFieldCollection::setUp in tests/protected_node.field_collection.test
Prepare users for protected node's tests.
ProtectedNodeFork::setUp in tests/protected_node.fork.test
Prepare users for protected node's tests.
ProtectedNodeGlobalPassword::setUp in tests/protected_node.global.test
Prepare users for protected node's tests.
ProtectedNodeMail::setUp in tests/protected_node.mail_test.test
Prepare users for protected node's tests.

... See full list

File

tests/protected_node.test, line 19
Base test class.

Class

ProtectedNodeBaseTestCase
This class adds the requirements for all protected_node test classes.

Code

public function setUp() {

  // See DrupalWebTestCase::setUp().
  // Install modules needed for this test. This could have been passed in as
  // either a single array argument or a variable number of string arguments.
  $modules = func_get_args();
  if (isset($modules[0]) && is_array($modules[0])) {
    $modules = $modules[0];
  }
  elseif (isset($modules[0]) && !is_array($modules[0])) {
    $modules = array(
      $modules[0],
    );
  }
  else {
    $modules = array();
  }
  $modules = array_merge(array(
    'protected_node',
  ), $modules);
  parent::setUp($modules);

  // Set the group.
  $this->group = 'Protected Node';

  // User with all needed permissions.
  $this->adminUser = $this
    ->drupalCreateUser(array(
    'access protected node password form',
    'edit any protected node password',
    'edit protected content',
    'administer site configuration',
    'administer nodes',
    'bypass node access',
    'administer content types',
    'administer paragraphs bundles',
  ));

  // User with access protected node permission.
  $this->normalAccessAllowedUser = $this
    ->drupalCreateUser(array(
    'access protected node password form',
  ));

  // User with access protected node permission.
  $this->bypassViewAccessAllowedUser = $this
    ->drupalCreateUser(array(
    'access protected node password form',
    'view protected content',
  ));

  // User with view published content permission.
  $this->normalNonAccessAllowedUser = $this
    ->drupalCreateUser(array(
    'access content',
  ));
}