You are here

public function OptimizelyTestUserRoleTestCase::setUp in Optimizely 7.2

Same name and namespace in other branches
  1. 7.3 optimizely.test \OptimizelyTestUserRoleTestCase::setUp()

OptimizelyTestAdminRoleCase setUp().

Overrides DrupalWebTestCase::setUp

File

./optimizely.test, line 37
Optimizely Tests

Class

OptimizelyTestUserRoleTestCase
OptimizelyTestUserRoleTestCase: Create anonymous, authenticated and privileged user to test access to module related pages.

Code

public function setUp() {

  // Enable any modules required for the test
  parent::setUp('optimizely');
  $this->anonymous_user = $this
    ->drupalCreateUser(array());
  $this->authenticated_user = $this
    ->drupalCreateUser(array(
    'access content',
  ));

  // Create and log in an admin user. The user will have the privilege
  // 'administer optimizely'. This privaged is need to access all administration
  // functionality of the module.
  $this->privileged_user = $this
    ->drupalCreateUser(array(
    'administer optimizely',
    'create page content',
    'edit own page content',
    'administer url aliases',
    'create url aliases',
  ));
}