You are here

public function OptimizelyTestUserPermissionsCase::testUserPermissions in Optimizely 7.3

Same name and namespace in other branches
  1. 7.2 optimizely.test \OptimizelyTestUserPermissionsCase::testUserPermissions()

File

./optimizely.test, line 758
Optimizely Tests

Class

OptimizelyTestUserPermissionsCase
Web Tests

Code

public function testUserPermissions() {
  $permissions = array(
    'name' => 'administer optimizely',
  );
  $valid = $this
    ->checkPermissions($permissions);
  $this
    ->assertTrue($valid, $permissions['name'] . t(' is a valid permission.'));
  $this
    ->drupalGet('admin/config/system/optimizely');
  $this
    ->assertResponse(200, t('access allowed'));
  $this
    ->drupalLogout();
  $this
    ->drupalGet('admin/config/system/optimizely');
  $this
    ->assertResponse(403, t('access denied'));
}