pmtimetracking.test in Drupal PM (Project Management) 7.3
Same filename and directory in other branches
Test definitions for PM Timetracking.
File
pmtimetracking/pmtimetracking.testView source
<?php
/**
* @file
* Test definitions for PM Timetracking.
*/
/**
* Define a test case for PM Timetracking.
*/
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.'));
}
}
Classes
Name | Description |
---|---|
PMTimetrackingTestCase | Define a test case for PM Timetracking. |