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