You are here

function ContentCrudTestCase::loginWithPermissions in Content Construction Kit (CCK) 6.2

Same name and namespace in other branches
  1. 6.3 tests/content.crud.test \ContentCrudTestCase::loginWithPermissions()
  2. 6 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.

4 calls to ContentCrudTestCase::loginWithPermissions()
ContentCrudMultipleToSingleTest::setUp in tests/content.crud.test
Enable CCK, Text, and Schema modules.
ContentCrudSingleToMultipleTest::setUp in tests/content.crud.test
Enable CCK, Text, and Schema modules.
ContentOptionWidgetTest::setUp in tests/content.crud.test
Enable CCK, Text, and Schema modules.
ContentUICrud::setUp in tests/content.crud.test
Enable CCK, Text, and Schema modules.

File

tests/content.crud.test, line 232

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
    ->drupalCreateUser($permissions);
  $this
    ->drupalLogin($user);
}