casetracker_basic.test in Case Tracker 7
File
tests/casetracker_basic.test
View source
<?php
class CasetrackerBasicTest extends DrupalWebTestCase {
function getInfo() {
return array(
'name' => t('Project and case creation.'),
'description' => t('Create project and cases using the casetracker_basic
content types'),
'group' => t('Case Tracker'),
);
}
function setUp() {
parent::setUp('views', 'casetracker', 'casetracker_basic');
}
function testCasetrackerBasicCreation() {
$auth_user = $this
->drupalCreateUser(array(
'access content',
'create projects',
'create cases',
));
$this
->drupalLogin($auth_user);
$edit = array(
'title' => $this
->randomName(32),
'body' => $this
->randomName(64),
);
$this
->drupalPost('node/add/casetracker-basic-project', $edit, t('Save'));
$text = t('Project !name has been created.', array(
'!name' => $edit['title'],
));
$this
->assertText($text);
$this
->clickLink(t('add Case'));
$edit = array(
'title' => $this
->randomName(32),
'body' => $this
->randomName(64),
'casetracker[case_priority_id]' => 2,
'casetracker[case_type_id]' => 11,
);
$this
->drupalPost(NULL, $edit, t('Save'));
$text = t('Case !name has been created.', array(
'!name' => $edit['title'],
));
$this
->assertText($text);
}
}