| 1 |
<?php
|
| 2 |
// $Id: workflow_named_transitions.test,v 1.2 2008/12/23 18:13:31 deekayen Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* Tests for the Workflow Named Transitions module.
|
| 7 |
*/
|
| 8 |
|
| 9 |
class WorkflowNamedTransitionsTest extends DrupalWebTestCase {
|
| 10 |
function getInfo() {
|
| 11 |
return array(
|
| 12 |
'name' => 'Workflow Named Transitions Test',
|
| 13 |
'description' => "This tests whether the Edit Labels tab exists in the workflow area.",
|
| 14 |
'group' => 'Workflow'
|
| 15 |
);
|
| 16 |
}
|
| 17 |
|
| 18 |
function setUp() {
|
| 19 |
parent::setUp('workflow', 'workflow_named_transitions');
|
| 20 |
}
|
| 21 |
|
| 22 |
function testEditLabelsExistsAdmin() {
|
| 23 |
$user = $this->drupalCreateUser(array('administer workflow'));
|
| 24 |
$this->drupalLogin($user);
|
| 25 |
$this->drupalGet('admin/build/workflow');
|
| 26 |
// HTML of the Edit labels tab
|
| 27 |
$this->assertRaw(sprintf('admin/build/workflow/labels">%s</a>', t('Edit labels')), t('Edit labels tab found'));
|
| 28 |
$this->drupalGet('admin/build/workflow/labels');
|
| 29 |
$this->assertResponse('200');
|
| 30 |
}
|
| 31 |
|
| 32 |
function testEditLabelsMissing() {
|
| 33 |
$user = $this->drupalCreateUser(array('access content'));
|
| 34 |
$this->drupalLogin($user);
|
| 35 |
$this->drupalGet('admin/build/workflow');
|
| 36 |
// HTML of the Edit labels tab
|
| 37 |
$this->assertNoRaw(sprintf('admin/build/workflow/labels">%s</a>', t('Edit labels')), t('Edit labels tab not found'));
|
| 38 |
$this->drupalGet('admin/build/workflow/labels');
|
| 39 |
$this->assertResponse('403');
|
| 40 |
}
|
| 41 |
|
| 42 |
function tearDown() {
|
| 43 |
parent::tearDown();
|
| 44 |
}
|
| 45 |
}
|