workflow_named_transitions.test 1.3 KB

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