You are here

public function PMInvoiceTestCase::testpminvoiceAccess in Drupal PM (Project Management) 7

Test case covering access of invoice list.

File

pminvoice/pminvoice.test, line 29
Test definitions for the PM Invoice module.

Class

PMInvoiceTestCase
@file Test definitions for the PM Invoice module.

Code

public function testpminvoiceAccess() {
  $this
    ->drupalGet('pm/invoices');
  $this
    ->assertResponse(403, t('Make sure access is denied to Project Management Invoices list for anonymous user'));
  $basic_user = $this
    ->drupalCreateUser();
  $this
    ->drupalLogin($basic_user);
  $this
    ->drupalGet('pm/invoices');
  $this
    ->assertResponse(403, t('Make sure access is denied to Project Management Invoices list for basic user'));
  $privileged_user = $this
    ->drupalCreateUser(array(
    'Project Management invoice: access',
  ));
  $this
    ->drupalLogin($privileged_user);
  $this
    ->drupalGet('pm/invoices');
  $this
    ->assertText(t('Invoices'), t('Make sure the correct page has been displayed by checking that the title is "Invoices".'));
}