You are here

class PMTimetrackingTestCase in Drupal PM (Project Management) 8

Same name and namespace in other branches
  1. 7.3 pmtimetracking/pmtimetracking.test \PMTimetrackingTestCase
  2. 7 pmtimetracking/pmtimetracking.test \PMTimetrackingTestCase
  3. 7.2 pmtimetracking/pmtimetracking.test \PMTimetrackingTestCase

Define a test case for PM Timetracking.

Hierarchy

Expanded class hierarchy of PMTimetrackingTestCase

File

pmtimetracking/pmtimetracking.test, line 10
Test definitions for PM Timetracking.

View source
class PMTimetrackingTestCase extends DrupalWebTestCase {

  /**
   * Provides metadata about this group of test cases.
   */
  public static function getInfo() {
    return array(
      'name' => t('PM Timetracking Functionality'),
      'description' => t('Test the functionality of the PM Timetracking module'),
      'group' => 'Project Management',
    );
  }

  /**
   * Standard configuration for all test cases.
   */
  public function setUp() {
    parent::setUp('pm', 'pmtimetracking');
  }

  /**
   * Test case covering creation of pmtimetrackings.
   */
  public function testpmtimetrackingCreate() {

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

    // Create test content.
    $timetracking = array(
      'title' => $this
        ->randomName(32),
    );
    $this
      ->drupalPost('node/add/pmtimetracking', $timetracking, t('Save'));
    $this
      ->assertText(t('Timetracking @title has been created.', array(
      '@title' => $timetracking['title'],
    )));
  }

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

}

Members

Namesort descending Modifiers Type Description Overrides
PMTimetrackingTestCase::getInfo public static function Provides metadata about this group of test cases.
PMTimetrackingTestCase::setUp public function Standard configuration for all test cases.
PMTimetrackingTestCase::testpmtimetrackingCreate public function Test case covering creation of pmtimetrackings.
PMTimetrackingTestCase::testpmtimetrackingUninstall public function Tests module uninstall path.