public function RngRegistrationAccessTest::testRegisterSelfRuleRoleAlternative in RNG - Events and Registrations 8
Same name and namespace in other branches
- 8.2 tests/src/Kernel/RngRegistrationAccessTest.php \Drupal\Tests\rng\Kernel\RngRegistrationAccessTest::testRegisterSelfRuleRoleAlternative()
- 3.x tests/src/Kernel/RngRegistrationAccessTest.php \Drupal\Tests\rng\Kernel\RngRegistrationAccessTest::testRegisterSelfRuleRoleAlternative()
Test register self rule a role the user does not have.
File
- tests/
src/ Kernel/ RngRegistrationAccessTest.php, line 95
Class
- RngRegistrationAccessTest
- Tests ability to register for events..
Namespace
Drupal\Tests\rng\KernelCode
public function testRegisterSelfRuleRoleAlternative() {
$event_meta = $this
->createEvent();
$role1 = $this
->createRole([]);
$user1 = $this
->drupalCreateUser([
'rng register self',
]);
$this
->setCurrentUser($user1);
$this
->createUserRoleRules([
$role1 => $role1,
], [
'create' => TRUE,
]);
$this
->assertFalse($event_meta
->identitiesCanRegister('user', [
$user1
->id(),
]));
}