public function PMTicketTestCase::testpmticketAccess in Drupal PM (Project Management) 8
Same name and namespace in other branches
- 7.3 pmticket/pmticket.test \PMTicketTestCase::testpmticketAccess()
- 7 pmticket/pmticket.test \PMTicketTestCase::testpmticketAccess()
- 7.2 pmticket/pmticket.test \PMTicketTestCase::testpmticketAccess()
Test case covering access of ticket list.
File
- pmticket/
pmticket.test, line 34 - Test definitions for PM Ticket.
Class
- PMTicketTestCase
- Define a test case for PM Ticket.
Code
public function testpmticketAccess() {
$this
->drupalGet('pm/tickets');
$this
->assertResponse(403, t('Make sure access is denied to Project Management Tickets list for anonymous user'));
$basic_user = $this
->drupalCreateUser();
$this
->drupalLogin($basic_user);
$this
->drupalGet('pm/tickets');
$this
->assertResponse(403, t('Make sure access is denied to Project Management Tickets list for basic user'));
$privileged_user = $this
->drupalCreateUser(array(
'Project Management Ticket: access',
));
$this
->drupalLogin($privileged_user);
$this
->drupalGet('pm/tickets');
$this
->assertText(t('Tickets'), t('Make sure the correct page has been displayed by checking that the title is "Tickets".'));
}