You are here

public function PMTimetrackingTestCase::testpmtimetrackingCreate in Drupal PM (Project Management) 7.2

Same name and namespace in other branches
  1. 8 pmtimetracking/pmtimetracking.test \PMTimetrackingTestCase::testpmtimetrackingCreate()
  2. 7.3 pmtimetracking/pmtimetracking.test \PMTimetrackingTestCase::testpmtimetrackingCreate()
  3. 7 pmtimetracking/pmtimetracking.test \PMTimetrackingTestCase::testpmtimetrackingCreate()

Test case covering creation of pmtimetrackings.

File

pmtimetracking/pmtimetracking.test, line 33
Test definitions for PM Timetracking.

Class

PMTimetrackingTestCase
Define a test case for PM Timetracking.

Code

public function testpmtimetrackingCreate() {

  // Log in with permission to create test content.
  $user = $this
    ->drupalCreateUser(array(
    'create pmorganization content',
    'create pmproject content',
    'create pmtask content',
    'create pmticket content',
    'create pmtimetracking 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),
  );
  $timetracking = 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
    ->drupalPost('node/add/pmtimetracking', $timetracking, t('Save'));
  $this
    ->assertText(t('Timetracking @title has been created.', array(
    '@title' => $timetracking['title'],
  )));
}