diff --git a/modules/state_flow/tests/state_flow.test b/modules/state_flow/tests/state_flow.test index 60bf13d..2368e07 100644 --- a/modules/state_flow/tests/state_flow.test +++ b/modules/state_flow/tests/state_flow.test @@ -466,7 +466,7 @@ class StateFlowWebTestCase extends DrupalWebTestCase { $this->assertEqual(count($tr), 1, 'There is a table row with for revision 6. It is in a Draft state and not in the node table.'); /** - * Test the unpublish step. + * Test the unpublish step and verify the Views results. */ // Unpublish the whole node. @@ -498,7 +498,7 @@ class StateFlowWebTestCase extends DrupalWebTestCase { } /** - * Test the unpublish event. + * Test the just the unpublish event and verify access/non-access for anonymous users. */ function testUnpublish() { @@ -516,13 +516,10 @@ class StateFlowWebTestCase extends DrupalWebTestCase { // Log back in and unpublish. $this->stateFlowLoginAdmin(); - $edit = array(); $edit['event'] = 'unpublish'; $edit['event_comment'] = $this->randomName(8); - - $new_title = $this->randomName(8); - $edit['title'] = $new_title; + $edit['title'] = $this->randomName(8); $this->drupalPost('node/1/edit', $edit, t('Save')); // Log out. Verify the node is not publicly accessible. @@ -530,22 +527,33 @@ class StateFlowWebTestCase extends DrupalWebTestCase { $this->drupalGet('node/1'); $this->assertResponse(403, 'The node is not publicly accessible.'); - // Log in and publish from the Views tab. + // Log in and publish from the Views tab. Send back to draft first. $this->stateFlowLoginAdmin(); $edit = array(); $edit['event'] = 'to draft'; $edit['event_comment'] = $this->randomName(8); $this->drupalPost("node/1/revisions-state-flow-states", $edit, t('Update State')); - $edit = array(); $edit['event'] = 'publish'; $edit['event_comment'] = $this->randomName(8); $this->drupalPost("node/1/revisions-state-flow-states", $edit, t('Update State')); - // Log out. Verify the node is publicly accessible. + // Make a forward revision draft. + $edit = array(); + $edit['event'] = 'to draft'; + $edit['event_comment'] = $this->randomName(8); + $this->drupalPost('node/1/edit', $edit, t('Save')); + + // Unpublish from the Views tab. + $edit = array(); + $edit['event'] = 'unpublish'; + $edit['event_comment'] = $this->randomName(8); + $this->drupalPost("node/1/revisions-state-flow-states", $edit, t('Update State')); + + // Log out. Verify the node is not publicly accessible. $this->drupalLogout(); - $this->drupalGet("node/1"); - $this->assertResponse(200, 'The node is publicly accessible.'); + $this->drupalGet('node/1'); + $this->assertResponse(403, 'The node is not publicly accessible.'); } }