You are here

public function PMTicketTestCase::testpmticketAccess in Drupal PM (Project Management) 7

Same name and namespace in other branches
  1. 8 pmticket/pmticket.test \PMTicketTestCase::testpmticketAccess()
  2. 7.3 pmticket/pmticket.test \PMTicketTestCase::testpmticketAccess()
  3. 7.2 pmticket/pmticket.test \PMTicketTestCase::testpmticketAccess()

Test case covering access of ticket list.

File

pmticket/pmticket.test, line 29
Test definitions for the PM Ticket module.

Class

PMTicketTestCase
@file Test definitions for the PM Ticket module.

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".'));
}