You are here

public function PMTestCase::testpmAccess in Drupal PM (Project Management) 7

Same name and namespace in other branches
  1. 8 pm.test \PMTestCase::testpmAccess()
  2. 7.3 pm.test \PMTestCase::testpmAccess()
  3. 7.2 pm.test \PMTestCase::testpmAccess()

Tests access to Project Management pages.

File

./pm.test, line 28
Tests for the Project Management module

Class

PMTestCase
@file Tests for the Project Management module

Code

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