You are here

pmteam.test in Drupal PM (Project Management) 7.3

Same filename and directory in other branches
  1. 8 pmteam/pmteam.test
  2. 7 pmteam/pmteam.test
  3. 7.2 pmteam/pmteam.test

Test definitions for PM Team.

File

pmteam/pmteam.test
View source
<?php

/**
 * @file
 * Test definitions for PM Team.
 */

/**
 * Define a test case for PM Team.
 */
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', 'pmteam');
  }

  /**
   * Tests creation of pmteam nodes.
   */
  public function testpmteamCreate() {

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

    // Create test content.
    $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'],
    )));
  }

  /**
   * Tests module uninstall path.
   */
  public function testpmteamUninstall() {
    $module = array(
      'pmteam',
    );
    module_disable($module);
    $result = drupal_uninstall_modules($module);
    $this
      ->AssertTrue($result, t('Module successfully uninstalled.'));
  }

}

Classes

Namesort descending Description
PMTeamTestCase Define a test case for PM Team.