pmtimetracking.test in Drupal PM (Project Management) 7
Same filename and directory in other branches
Test definitions for the PM Timetracking module.
File
pmtimetracking/pmtimetracking.testView source
<?php
/**
* @file
* Test definitions for the PM Timetracking module.
*/
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', 'pmorganization', 'pmproject', 'pmtask', 'pmticket', 'pmtimetracking');
}
/**
* Test case covering creation of pmtimetrackings.
*/
public function testpmtimetrackingCreate() {
// Create and login user
$user = $this
->drupalCreateUser(array(
'Project Management Organization: add',
'Project Management Organization: view all',
'Project Management Project: add',
'Project Management Project: view all',
'Project Management Task: add',
'Project Management Task: view all',
'Project Management Ticket: add',
'Project Management Ticket: view all',
'Project Management Timetracking: add',
'Project Management Timetracking: view all',
));
$this
->drupalLogin($user);
// Create organization and invoice
$org = array(
'title' => $this
->randomName(32),
'body[und][0][value]' => $this
->randomName(64),
);
$prj = array(
'title' => $this
->randomName(32),
'organization_nid' => '1',
);
$task = array(
'title' => $this
->randomName(32),
'body[und][0][value]' => $this
->randomName(64),
);
$ticket = array(
'title' => $this
->randomName(32),
'body[und][0][value]' => $this
->randomName(64),
);
$timetracking = array(
'title' => $this
->randomName(32),
'body[und][0][value]' => $this
->randomName(64),
);
$this
->drupalPost('node/add/pmorganization', $org, t('Save'));
$this
->drupalPost('node/add/pmproject', $prj, t('Save'));
$this
->drupalPost('node/add/pmtask', $task, t('Save'));
$this
->drupalPost('node/add/pmticket', $ticket, t('Save'));
$this
->drupalPost('node/add/pmtimetracking', $timetracking, t('Save'));
$this
->assertText(t('Timetracking @title has been created.', array(
'@title' => $timetracking['title'],
)));
}
}
Classes
Name | Description |
---|---|
PMTimetrackingTestCase | @file Test definitions for the PM Timetracking module. |