You are here

protected function EntityLegalTestCase::createDocumentVersionAcceptance in Entity Legal 7.2

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

Create an acceptance entity for a given document version.

Parameters

EntityLegalDocumentVersion $version: The version to create the acceptance for.

object $user: The user object to associate the acceptance with.

Return value

EntityLegalDocumentAcceptance The created acceptance entity.

File

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

Class

EntityLegalTestCase
Common Simpletest class for all legal tests.

Code

protected function createDocumentVersionAcceptance(EntityLegalDocumentVersion $version, $user) {
  $entity = entity_create(ENTITY_LEGAL_DOCUMENT_ACCEPTANCE_ENTITY_NAME, array(
    'document_version_name' => $version
      ->identifier(),
    'user' => $user->uid,
  ));
  $entity
    ->save();
  return $entity;
}