function ContentCrudTestCase::loginWithPermissions in Content Construction Kit (CCK) 6
Same name and namespace in other branches
- 6.3 tests/content.crud.test \ContentCrudTestCase::loginWithPermissions()
- 6.2 tests/content.crud.test \ContentCrudTestCase::loginWithPermissions()
Creates a user / role with certain permissions and then logs in as that user
Parameters
$permissions Array containing list of permissions. If not given, defaults to: access content, administer content types, administer nodes and administer filters.
2 calls to ContentCrudTestCase::loginWithPermissions()
File
- tests/
content.crud.test, line 215
Class
- ContentCrudTestCase
- Base class for CCK CRUD tests. Defines many helper functions useful for writing CCK CRUD tests.
Code
function loginWithPermissions($permissions = NULL) {
if (!isset($permissions)) {
$permissions = array(
'access content',
'administer content types',
'administer nodes',
'administer filters',
);
}
$user = $this
->drupalCreateUserRolePerm($permissions);
$this
->drupalLoginUser($user);
}