protected function CommerceReportsBaseTestCase::permissionBuilder in Commerce Reporting 7.3
Helper function to get different combinations of permission sets.
Parameters
$set: Can be a single string (from the following) or can be an array containing multiple values that should be merged: 'site admin': Admin permissions for Drupal core modules 'store admin': All commerce "administer X" permissions
Overrides CommerceBaseTestCase::permissionBuilder
File
- tests/
commerce_reports.test, line 120 - Unit tests for the commerce reports module.
Class
- CommerceReportsBaseTestCase
- @file Unit tests for the commerce reports module.
Code
protected function permissionBuilder($sets) {
if (is_string($sets)) {
$sets = array(
$sets,
);
}
$store_admin = array(
'access commerce reports',
);
$final_permissions = parent::permissionBuilder($sets);
foreach ($sets as $set) {
switch ($set) {
case 'store admin':
$final_permissions = array_unique(array_merge($final_permissions, $store_admin));
break;
}
}
return $final_permissions;
}