You are here

public function PMNoteTestCase::testpmnoteAccess in Drupal PM (Project Management) 7

Same name and namespace in other branches
  1. 8 pmnote/pmnote.test \PMNoteTestCase::testpmnoteAccess()
  2. 7.3 pmnote/pmnote.test \PMNoteTestCase::testpmnoteAccess()
  3. 7.2 pmnote/pmnote.test \PMNoteTestCase::testpmnoteAccess()

Access test case.

File

pmnote/pmnote.test, line 33
Test definitions for the PM Note module.

Class

PMNoteTestCase
Test definition for the PM Note module.

Code

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