protected function EntityLegalTestTrait::createUserWithAcceptancePermissions in Entity Legal 3.0.x
Same name and namespace in other branches
- 8.2 tests/src/Traits/EntityLegalTestTrait.php \Drupal\Tests\entity_legal\Traits\EntityLegalTestTrait::createUserWithAcceptancePermissions()
- 4.0.x tests/src/Traits/EntityLegalTestTrait.php \Drupal\Tests\entity_legal\Traits\EntityLegalTestTrait::createUserWithAcceptancePermissions()
Creates an account that is able to view and re-accept a given document.
Parameters
\Drupal\entity_legal\EntityLegalDocumentInterface $document: The legal document the user is able to view and accept.
Return value
\Drupal\Core\Session\AccountInterface The user.
4 calls to EntityLegalTestTrait::createUserWithAcceptancePermissions()
- EntityLegalMethodsTest::testMessageMethod in src/
Tests/ EntityLegalMethodsTest.php - Drupal message method test.
- EntityLegalMethodsTest::testPopupMethod in src/
Tests/ EntityLegalMethodsTest.php - JQuery UI dialog method test.
- RedirectMethodTest::testMessageDisplay in tests/
src/ Functional/ RedirectMethodTest.php - Tests the case when the origin pages has set messages.
- RedirectMethodTest::_testRedirectMethod in tests/
src/ Functional/ RedirectMethodTest.php - Redirection method test.
File
- tests/
src/ Traits/ EntityLegalTestTrait.php, line 96
Class
- EntityLegalTestTrait
- Code reusing for Entity Legal tests.
Namespace
Drupal\Tests\entity_legal\TraitsCode
protected function createUserWithAcceptancePermissions(EntityLegalDocumentInterface $document) {
$account = $this
->drupalCreateUser([
$document
->getPermissionView(),
$document
->getPermissionExistingUser(),
]);
return $account;
}