You are here

public function PMOrganizationTestCase::testpmorganizationAccess in Drupal PM (Project Management) 7

Test case covering access of organization list.

File

pmorganization/pmorganization.test, line 29
Test definitions for the PM Organization module

Class

PMOrganizationTestCase
@file Test definitions for the PM Organization module

Code

public function testpmorganizationAccess() {
  $this
    ->drupalGet('pm/organizations');
  $this
    ->assertResponse(403, t('Make sure access is denied to Project Management Organizations list for anonymous user'));
  $basic_user = $this
    ->drupalCreateUser();
  $this
    ->drupalLogin($basic_user);
  $this
    ->drupalGet('pm/organizations');
  $this
    ->assertResponse(403, t('Make sure access is denied to Project Management Organizations list for basic user'));
  $privileged_user = $this
    ->drupalCreateUser(array(
    'Project Management Organization: access',
  ));
  $this
    ->drupalLogin($privileged_user);
  $this
    ->drupalGet('pm/organizations');
  $this
    ->assertText(t('Organizations'), t('Make sure the correct page has been displayed by checking that the title is "Organizations".'));
}