You are here

protected function FeaturesUserTestCase::_test_user_permission in Features 7

Same name and namespace in other branches
  1. 6 tests/features.test \FeaturesUserTestCase::_test_user_permission()
  2. 7.2 tests/features.test \FeaturesUserTestCase::_test_user_permission()

File

tests/features.test, line 159

Class

FeaturesUserTestCase
User permission component tests for Features

Code

protected function _test_user_permission($op = 'load') {
  switch ($op) {
    case 'load':
      $permissions = user_role_permissions(array(
        DRUPAL_AUTHENTICATED_RID => 'authenticated user',
      ));
      return !empty($permissions[DRUPAL_AUTHENTICATED_RID]['create features_test content']);
    case 'override':
      user_role_change_permissions(DRUPAL_AUTHENTICATED_RID, array(
        'create features_test content' => 0,
      ));
      break;
  }
}