public function PMTestCase::testpmAccess in Drupal PM (Project Management) 8
Same name and namespace in other branches
- 7.3 pm.test \PMTestCase::testpmAccess()
- 7 pm.test \PMTestCase::testpmAccess()
- 7.2 pm.test \PMTestCase::testpmAccess()
Tests access to Project Management pages.
File
- ./
pm.test, line 33 - Test definitions for Project Management.
Class
- PMTestCase
- Define a test case for Project Management.
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'), t('Make sure the correct page has been displayed by checking that the title is "Project Management".'));
}