You are here

public function PMProjectTestCase::testpmprojectAccess in Drupal PM (Project Management) 7

Same name and namespace in other branches
  1. 8 pmproject/pmproject.test \PMProjectTestCase::testpmprojectAccess()
  2. 7.3 pmproject/pmproject.test \PMProjectTestCase::testpmprojectAccess()
  3. 7.2 pmproject/pmproject.test \PMProjectTestCase::testpmprojectAccess()

Test case covering access of project list.

File

pmproject/pmproject.test, line 29
Test definitions for the PM Project module

Class

PMProjectTestCase
@file Test definitions for the PM Project module

Code

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