function RegistrationStandardTestCase::testRegistrationCreateAccess in Entity Registration 7
Same name and namespace in other branches
- 8.2 tests/registration.test \RegistrationStandardTestCase::testRegistrationCreateAccess()
- 7.2 tests/registration.test \RegistrationStandardTestCase::testRegistrationCreateAccess()
File
- tests/
registration.test, line 344 - 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 ' . $this->registration_type_name . ' registration other users',
'create ' . $this->registration_type_name . ' registration other anonymous',
);
$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');
}