You are here

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

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

Test case covering creation of pmprojects.

File

pmproject/pmproject.test, line 54
Test definitions for PM Project.

Class

PMProjectTestCase
Define a test case for PM Project.

Code

public function testpmprojectCreate() {

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

  // Create test content.
  $org = array(
    'title' => $this
      ->randomName(32),
  );
  $prj = array(
    'title' => $this
      ->randomName(32),
    'pmproject_parent[und]' => '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'],
  )));
}