Fix bug #11286: Tell the difference between end of Workflow, and unable to load WorkflowActivity.

Tests are added for new methods.  The changes to Workflow::Instance->run are peripherally
tested in Workflow Activity tests.
This commit is contained in:
Colin Kuskie 2009-12-07 13:07:46 -08:00
parent 89ea0e7cea
commit c845849da0
5 changed files with 105 additions and 19 deletions

View file

@ -16,7 +16,7 @@ use WebGUI::Session;
use WebGUI::Workflow;
use WebGUI::Workflow::Cron;
use WebGUI::Utility qw/isIn/;
use Test::More tests => 67; # increment this value for each test you create
use Test::More tests => 75; # increment this value for each test you create
use Test::Deep;
my $session = WebGUI::Test->session;
@ -144,6 +144,28 @@ my $decayKarma = $wf3->addActivity('WebGUI::Workflow::Activity::DecayKarma');
my $cleanTemp = $wf3->addActivity('WebGUI::Workflow::Activity::CleanTempStorage');
my $oldTrash = $wf3->addActivity('WebGUI::Workflow::Activity::PurgeOldTrash');
#####################################################################
#
# getNextActivityId
#
#####################################################################
is $wf3->getNextActivityId($decayKarma->getId), $cleanTemp->getId, 'getNextActivityId: first activity to second';
is $wf3->getNextActivityId($cleanTemp->getId), $oldTrash->getId, '... second activity to third';
is $wf3->getNextActivityId($oldTrash->getId), undef, '... last returns undef';
is $wf3->getNextActivityId(), $decayKarma->getId, '... with no activityId, returns the first';
#####################################################################
#
# hasNextActivity
#
#####################################################################
ok $wf3->hasNextActivity($decayKarma->getId), 'hasNextActivityId: first activity to second';
ok $wf3->hasNextActivity($cleanTemp->getId), '... second activity to third';
ok $wf3->hasNextActivity(), '... with no activityId, returns the first';
ok !$wf3->hasNextActivity($oldTrash->getId), '... last returns undef';
#####################################################################
#
# Activity tests, promote, demote, reorder, accessing, deleting