You are here

public function PMTicketTestCase::testpmticketCreate in Drupal PM (Project Management) 7.2

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

Test case covering creation of pmtickets.

File

pmticket/pmticket.test, line 51
Test definitions for PM Ticket.

Class

PMTicketTestCase
Define a test case for PM Ticket.

Code

public function testpmticketCreate() {

  // Log in with permission to create test content.
  $user = $this
    ->drupalCreateUser(array(
    'create pmorganization content',
    'create pmproject content',
    'create pmtask content',
    'create pmticket content',
  ));
  $this
    ->drupalLogin($user);

  // Create test content.
  $org = array(
    'title' => $this
      ->randomName(32),
  );
  $prj = array(
    'title' => $this
      ->randomName(32),
  );
  $task = array(
    'title' => $this
      ->randomName(32),
  );
  $ticket = array(
    'title' => $this
      ->randomName(32),
  );
  $this
    ->drupalPost('node/add/pmorganization', $org, t('Save'));
  $this
    ->drupalPost('node/add/pmproject', $prj, t('Save'));
  $this
    ->drupalPost('node/add/pmtask', $task, t('Save'));
  $this
    ->drupalPost('node/add/pmticket', $ticket, t('Save'));
  $this
    ->assertText(t('Ticket @title has been created.', array(
    '@title' => $ticket['title'],
  )));
}