public function RngRegistrationAccessTest::testRegisterSelfNoDuplicates in RNG - Events and Registrations 8.2
Same name and namespace in other branches
- 8 tests/src/Kernel/RngRegistrationAccessTest.php \Drupal\Tests\rng\Kernel\RngRegistrationAccessTest::testRegisterSelfNoDuplicates()
- 3.x tests/src/Kernel/RngRegistrationAccessTest.php \Drupal\Tests\rng\Kernel\RngRegistrationAccessTest::testRegisterSelfNoDuplicates()
Test register self no duplicates.
File
- tests/
src/ Kernel/ RngRegistrationAccessTest.php, line 120
Class
- RngRegistrationAccessTest
- Tests ability to register for events..
Namespace
Drupal\Tests\rng\KernelCode
public function testRegisterSelfNoDuplicates() {
$event_meta = $this
->createEvent([
EventManagerInterface::FIELD_ALLOW_DUPLICATE_REGISTRANTS => 0,
]);
$this
->createUserRoleRules([], [
'create' => TRUE,
]);
$user1 = $this
->drupalCreateUser([
'rng register self',
]);
$this
->setCurrentUser($user1);
$this
->assertTrue($event_meta
->identitiesCanRegister('user', [
$user1
->id(),
]));
$this
->createRegistration($event_meta
->getEvent(), $this->registrationType, [
$user1,
]);
$this
->assertFalse($event_meta
->identitiesCanRegister('user', [
$user1
->id(),
]));
}