public function PMOrganizationTestCase::testpmorganizationList in Drupal PM (Project Management) 8
Same name and namespace in other branches
- 7.3 pmorganization/pmorganization.test \PMOrganizationTestCase::testpmorganizationList()
- 7.2 pmorganization/pmorganization.test \PMOrganizationTestCase::testpmorganizationList()
Test case ensuring that the list view is present.
File
- pmorganization/
pmorganization.test, line 33 - Test definitions for PM Organization.
Class
- PMOrganizationTestCase
- Define a test case for PM Organization.
Code
public function testpmorganizationList() {
// Anonymous user.
$this
->drupalGet('pm/organizations');
$this
->assertResponse(403, 'Access is denied to the anonymous user.');
// Authenticated user.
$authenticated_user = $this
->drupalCreateUser();
$this
->drupalLogin($authenticated_user);
$this
->drupalGet('pm/organizations');
$this
->assertResponse(403, 'Access is denied to the authenticated user.');
// Privileged user.
$privileged_user = $this
->drupalCreateUser(array(
'Project Management Organization: access',
));
$this
->drupalLogin($privileged_user);
$this
->drupalGet('pm/organizations');
$this
->assertText(t('Organizations'), t('Access granted for the privileged user. Correct page has been confirmed by checking that the title is "Organizations".'));
}