<?php
/**
 * @file
 * Test definitions for the PM Team module.
 */

/**
 * Class defining PM Team test cases.
 */
class PMTeamTestCase extends DrupalWebTestCase {

  /**
   * Defines meta data for PM Team test cases.
   */
  public static function getInfo() {
    return array(
      'name' => t('PM Team Functionality'),
      'description' => t('Test the functionality of the PM Team module'),
      'group' => 'Project Management',
    );
  }

  /**
   * Sets up all Project Management test cases.
   */
  public function setUp() {
    parent::setUp('views', 'pm', 'pmorganization', 'pmperson', 'pmteam');
  }

  /**
   * Tests creation of pmteam nodes.
   */
  public function testpmteamCreate() {
    // Create and login user
    $user = $this->drupalCreateUser(array('Project Management Team: add', 'Project Management Team: view all', 'Project Management Person: add', 'Project Management Person: view all'));
    $this->drupalLogin($user);

    // Create a team
    $team = array(
      'title' => $this->randomName(32),
    );

    $this->drupalPost('node/add/pmteam', $team, t('Save'));
    $this->assertText(t('Team @title has been created.', array('@title' => $team['title'])));;
  }
}
