public function PMNoteTestCase::testpmnoteAccess in Drupal PM (Project Management) 8
Same name and namespace in other branches
- 7.3 pmnote/pmnote.test \PMNoteTestCase::testpmnoteAccess()
- 7 pmnote/pmnote.test \PMNoteTestCase::testpmnoteAccess()
- 7.2 pmnote/pmnote.test \PMNoteTestCase::testpmnoteAccess()
Access test case.
File
- pmnote/
pmnote.test, line 33 - Test definitions for PM Note.
Class
- PMNoteTestCase
- Define a test case for PM Note.
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".'));
}