You are here

public function FppTestHelper::createUser in Fieldable Panels Panes (FPP) 7

Create a new user account with limited permissions.

Parameters

array $perms: Any permissions to be added to the user.

Return value

object A standard Drupal user object.

7 calls to FppTestHelper::createUser()
FppPermissionsTest::testCreateBundlePermission in tests/fpp.permissions.test
Confirm that the 'create bundle' permission works correctly.
FppPermissionsTest::testCreateEditBundlePermission in tests/fpp.permissions.test
Confirm that the 'edit bundle' permission works correctly.
FppPermissionsTest::testDeleteBundlePermission in tests/fpp.permissions.test
Confirm that the 'delete bundle' permission works correctly.
FppPermissionsTest::testEditBundlePermission in tests/fpp.permissions.test
Confirm that the 'edit bundle' permission doesn't allow FPP creation.
FppPermissionsTest::testListPermission in tests/fpp.permissions.test
Confirm that the 'list' permission works correctly.

... See full list

File

tests/fpp.helper.test, line 64
A base class for the Fieldable Panels Panes tests, provides shared methods.

Class

FppTestHelper
A base class for the Fieldable Panels Panes tests, provides shared methods.

Code

public function createUser(array $perms = array()) {

  // Reset the static variable used to identify permissions, otherwise it's
  // possible the permissions check in drupalCreateUser will fail.
  $this
    ->checkPermissions(array(), TRUE);
  cache_clear_all();
  return $this
    ->drupalCreateUser($perms);
}