You are here

public function PMProjectTestCase::testpmprojectCreate in Drupal PM (Project Management) 7

Same name and namespace in other branches
  1. 8 pmproject/pmproject.test \PMProjectTestCase::testpmprojectCreate()
  2. 7.3 pmproject/pmproject.test \PMProjectTestCase::testpmprojectCreate()
  3. 7.2 pmproject/pmproject.test \PMProjectTestCase::testpmprojectCreate()

Test case covering creation of pmprojects.

File

pmproject/pmproject.test, line 47
Test definitions for the PM Project module

Class

PMProjectTestCase
@file Test definitions for the PM Project module

Code

public function testpmprojectCreate() {

  // 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',
  ));
  $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',
  );
  $this
    ->drupalPost('node/add/pmorganization', $org, t('Save'));
  $this
    ->drupalPost('node/add/pmproject', $prj, t('Save'));
  $this
    ->assertText(t('Project @title has been created.', array(
    '@title' => $prj['title'],
  )));
}