From 27769a9b68aac56cb9061eecc504339d0243fac8 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 10 Sep 2008 23:27:34 +0000 Subject: [PATCH] Test a few more corner cases for effective 100% coverage --- t/Workflow.t | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/t/Workflow.t b/t/Workflow.t index 855033b50..64d835511 100644 --- a/t/Workflow.t +++ b/t/Workflow.t @@ -16,7 +16,7 @@ use WebGUI::Session; use WebGUI::Workflow; use WebGUI::Workflow::Cron; use WebGUI::Utility qw/isIn/; -use Test::More tests => 61; # increment this value for each test you create +use Test::More tests => 64; # increment this value for each test you create use Test::Deep; my $session = WebGUI::Test->session; @@ -73,6 +73,10 @@ $wf->set({'mode', 'serial'}); is(join('', $wf->isSingleton, $wf->isSerial, $wf->isParallel), '010', 'Is checks after setting mode to serial'); $wf->set({'mode', 'singleton'}); is(join('', $wf->isSingleton, $wf->isSerial, $wf->isParallel), '100', 'Is checks after setting mode to singleton'); +$wf->set({'isSerial' => 1}); +is(join('', $wf->isSingleton, $wf->isSerial, $wf->isParallel), '010', 'Is checks after setting mode to singleton'); +$wf->set({'isSingleton' => 1}); +is(join('', $wf->isSingleton, $wf->isSerial, $wf->isParallel), '100', 'Is checks after setting mode to singleton'); $wf->delete; ok(!defined WebGUI::Workflow->new($session, $wfId), 'deleted workflow cannot be retrieved'); @@ -194,6 +198,14 @@ cmp_deeply( 'delete activity works' ); +$wf3->deleteActivity('neverAWebGUIId'); + +cmp_deeply( + [ map { $_->getId } @{ $wf3->getActivities } ], + [ map { $_->getId } $oldTrash, $decayKarma, $trashClipboard], + 'delete activity requires a valid activityId to delete' +); + cmp_deeply( [ map { $_->get('sequenceNumber') } @{ $wf3->getActivities } ], [ 1,2,3 ],