You are here

public function PMIssueTestCase::testpmissueCreate in Drupal PM (Project Management) 7.2

Same name and namespace in other branches
  1. 8 pmissue/pmissue.test \PMIssueTestCase::testpmissueCreate()
  2. 7.3 pmissue/pmissue.test \PMIssueTestCase::testpmissueCreate()

Test of Issue node creation.

File

pmissue/pmissue.test, line 54
Test definitions for PM Issue.

Class

PMIssueTestCase
Define a test case for PM Issue.

Code

public function testpmissueCreate() {

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