function RegistrationStandardTestCase::testRegistrationCreateAccess in Entity Registration 8.2
Same name in this branch
- 8.2 tests/registration.test \RegistrationStandardTestCase::testRegistrationCreateAccess()
- 8.2 src/RegistrationStandardTestCase.php \Drupal\registration\RegistrationStandardTestCase::testRegistrationCreateAccess()
Same name and namespace in other branches
- 7.2 tests/registration.test \RegistrationStandardTestCase::testRegistrationCreateAccess()
- 7 tests/registration.test \RegistrationStandardTestCase::testRegistrationCreateAccess()
File
- tests/
registration.test, line 361 - Tests for the Registration module
Class
- RegistrationStandardTestCase
- Creates a registration type Create node entity type ensure registration type exists
Code
function testRegistrationCreateAccess() {
// With permissions.
$permissions = array(
'create ' . $this->registration_type_name . ' registration',
'create own ' . $this->registration_type_name . ' registration',
);
$this
->checkPermissions($permissions, TRUE);
// Reset permission cache
$user = $this
->drupalCreateUser($permissions);
$this
->drupalLogin($user);
$this
->drupalGet($this->host_entity_path . '/register');
$this
->assertResponse(403, t('Close default host entity status (database).'), 'Registration');
$this
->setHostEntitySettings(array(
'status' => 1,
));
$this
->drupalGet($this->host_entity_path . '/register');
$this
->assertResponse(200, t('Open default host entity status (database).'), 'Registration');
$this
->assertRaw(t('Save Registration'), t('User with create permissions access register tab.'), 'Registration');
$this
->assertFieldByName('who_is_registering');
}