You are here

protected function CommerceBaseTestCase::createUserWithPermissionHelper in Commerce Core 7

Wrapper to easily create users from arrays returned by permissionBuilder().

Parameters

$set: See permissionBuilder() function

Return value

A user with the permissions returned from permissionBuilder().

4 calls to CommerceBaseTestCase::createUserWithPermissionHelper()
CommerceBaseTestCase::createSiteAdmin in tests/commerce_base.test
Returns a site administrator user. Only has permissions for administering modules in Drupal core.
CommerceBaseTestCase::createStoreAdmin in tests/commerce_base.test
Returns a store administrator user. Only has permissions for administering Commerce modules.
CommerceBaseTestCase::createStoreCustomer in tests/commerce_base.test
Returns a store customer. It's a regular user with some Commerce permissions as access to checkout.
CommerceProductReferenceAdminTest::setUp in modules/product_reference/tests/commerce_product_reference.test
Implementation of setUp().

File

tests/commerce_base.test, line 186
Defines abstract base test class for the Commerce module tests.

Class

CommerceBaseTestCase
Abstract class for Commerce testing. All Commerce tests should extend this class.

Code

protected function createUserWithPermissionHelper($set) {
  $permissions = $this
    ->permissionBuilder($set);
  $user = $this
    ->drupalCreateUser($permissions);
  return $user;
}