class PMTimetrackingTestCase in Drupal PM (Project Management) 8
Same name and namespace in other branches
- 7.3 pmtimetracking/pmtimetracking.test \PMTimetrackingTestCase
- 7 pmtimetracking/pmtimetracking.test \PMTimetrackingTestCase
- 7.2 pmtimetracking/pmtimetracking.test \PMTimetrackingTestCase
Define a test case for PM Timetracking.
Hierarchy
- class \PMTimetrackingTestCase extends \DrupalWebTestCase
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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PMTimetrackingTestCase:: |
public static | function | Provides metadata about this group of test cases. | |
PMTimetrackingTestCase:: |
public | function | Standard configuration for all test cases. | |
PMTimetrackingTestCase:: |
public | function | Test case covering creation of pmtimetrackings. | |
PMTimetrackingTestCase:: |
public | function | Tests module uninstall path. |