You are here

public function PMPersonTestCase::testpmpersonAccess in Drupal PM (Project Management) 7

Access test case.

File

pmperson/pmperson.test, line 35
Test definitions for the PM Person module.

Class

PMPersonTestCase
Test definition for the PM Person module.

Code

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