You are here

protected function RequiredByRoleBasic::setUp in Required by role 7.2

Same name and namespace in other branches
  1. 7 tests/required_by_role_test/RequiredByRoleBasic.test \RequiredByRoleBasic::setUp()

Setup method.

Overrides DrupalWebTestCase::setUp

1 call to RequiredByRoleBasic::setUp()
RequiredByRoleCommonWebTestCase::setUp in tests/required_by_role_test/RequiredByRoleCommonWebTestCase.test
Setup method.
1 method overrides RequiredByRoleBasic::setUp()
RequiredByRoleCommonWebTestCase::setUp in tests/required_by_role_test/RequiredByRoleCommonWebTestCase.test
Setup method.

File

tests/required_by_role_test/RequiredByRoleBasic.test, line 26
Tests for Required by role module.

Class

RequiredByRoleBasic
Base class for all required by role web test cases.

Code

protected function setUp() {
  $this->basePermissions = array(
    'access content',
    'create ' . $this->entity_bundle . ' content',
    'edit any ' . $this->entity_bundle . ' content',
    'administer content types',
    'administer nodes',
    'administer filters',
    'access comments',
    'post comments',
    'access administration pages',
  );
  $this->common_modules[] = 'field';
  $this->common_modules[] = 'field_ui';
  $this->common_modules[] = 'required_by_role';
  $this->common_modules[] = 'required_by_role_test';
  parent::setUp($this->common_modules);

  // Create Basic page and Article node types.
  if ($this->profile != 'standard') {
    $this
      ->drupalCreateContentType(array(
      'type' => $this->entity_bundle,
      'name' => 'Article',
    ));
  }
  module_load_include('inc', 'field', 'field.crud');
  module_load_include('inc', 'node', 'node.pages');

  // Create a role for required fields.
  $this->required_fields_rid = $this
    ->drupalCreateRole($this->basePermissions, 'Required fields role');
}