You are here

public function PMTaskTestCase::testpmtaskCreate in Drupal PM (Project Management) 7

Same name and namespace in other branches
  1. 8 pmtask/pmtask.test \PMTaskTestCase::testpmtaskCreate()
  2. 7.3 pmtask/pmtask.test \PMTaskTestCase::testpmtaskCreate()
  3. 7.2 pmtask/pmtask.test \PMTaskTestCase::testpmtaskCreate()

Test of Task node creation.

File

pmtask/pmtask.test, line 51
Test definitions for the PM Task module

Class

PMTaskTestCase
Class defining PM Task test cases.

Code

public function testpmtaskCreate() {

  // Create and login user
  $user = $this
    ->drupalCreateUser(array(
    'Project Management Organization: add',
    'Project Management Organization: view all',
    'Project Management Project: add',
    'Project Management Project: view all',
    'Project Management Task: add',
    'Project Management Task: view all',
  ));
  $this
    ->drupalLogin($user);

  // Create organization and invoice
  $org = array(
    'title' => $this
      ->randomName(32),
    'body[und][0][value]' => $this
      ->randomName(64),
  );
  $prj = array(
    'title' => $this
      ->randomName(32),
    'organization_nid' => '1',
  );
  $task = array(
    'title' => $this
      ->randomName(32),
    'body[und][0][value]' => $this
      ->randomName(64),
  );
  $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
    ->assertText(t('Task @title has been created.', array(
    '@title' => $task['title'],
  )));
}