You are here

protected function EntityLegalTestCase::createUserWithAcceptancePermissions in Entity Legal 7.2

Same name and namespace in other branches
  1. 7 tests/entity_legal.common.test \EntityLegalTestCase::createUserWithAcceptancePermissions()

Create an account that is able to view and re-accept a given document.

Parameters

EntityLegalDocument $document: The legal document the user is able to view and accept.

Return value

object The user

3 calls to EntityLegalTestCase::createUserWithAcceptancePermissions()
EntityLegalMethodsTestCase::testMessageMethod in tests/entity_legal.methods.test
Drupal message method test.
EntityLegalMethodsTestCase::testPopupMethod in tests/entity_legal.methods.test
JQuery UI dialog method test.
EntityLegalMethodsTestCase::testRedirectMethod in tests/entity_legal.methods.test
Redirection method test.

File

tests/entity_legal.common.test, line 145
Common test class file.

Class

EntityLegalTestCase
Common Simpletest class for all legal tests.

Code

protected function createUserWithAcceptancePermissions(EntityLegalDocument $document) {
  $account = $this
    ->drupalCreateUser(array(
    $document
      ->getPermissionView(),
    $document
      ->getPermissionExistingUser(),
  ));
  return $account;
}