You are here

function PaymentWebTestCase::permissionLabel in Payment 7

Return permissions' human-readable titles and their machine names.

Parameters

array $permissions: The permissions' machine names.

Return value

string

1 call to PaymentWebTestCase::permissionLabel()
PaymentWebTestCase::assertEntityPermission in tests/PaymentWebTestCase.test
Test an entity's permissions.

File

tests/PaymentWebTestCase.test, line 158

Class

PaymentWebTestCase
Provides reusable code for testing payments and payment methods.

Code

function permissionLabel(array $permissions) {
  $info =& drupal_static(__CLASS__ . '_permission');
  if (is_null($info)) {
    $info = module_invoke_all('permission');
  }
  $labels = array();
  foreach ($permissions as $permission) {
    $labels[] = '<strong>' . $info[$permission]['title'] . ' (' . $permission . ')</strong>';
  }
  return implode(', ', $labels);
}