make mode and enabled sticky in the Workflow

This commit is contained in:
Colin Kuskie 2008-11-24 16:33:51 +00:00
parent b6cfd088c7
commit e86b9a7a6f
3 changed files with 18 additions and 5 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 => 64; # increment this value for each test you create
use Test::More tests => 67; # increment this value for each test you create
use Test::Deep;
my $session = WebGUI::Test->session;
@ -58,6 +58,14 @@ ok(!$wf->get('enabled'), 'workflow is disabled again');
is(scalar keys %{WebGUI::Workflow->getList($session, 'WebGUI::User')}, 1, 'There is only 1 WebGUI::User based workflow that ships with WebGUI');
##Throwing in another test here to test how enabled works. It should be sticky
$wf->set({enabled => 1});
ok($wf->get('enabled'), 'Enable workflow again');
$wf->set({description => 'Better stay enabled'});
ok($wf->get('enabled'), 'Workflow is enabled after setting the description');
$wf->set({enabled => 0});
##################################################
#
# Mode tests
@ -78,6 +86,10 @@ is(join('', $wf->isSingleton, $wf->isSerial, $wf->isParallel), '010', 'Is checks
$wf->set({'isSingleton' => 1});
is(join('', $wf->isSingleton, $wf->isSerial, $wf->isParallel), '100', 'Is checks after setting mode to singleton');
##Checking sticky mode settings
$wf->set({description => 'better stay singleton'});
ok($wf->isSingleton, 'After setting description, workflow is still singleton');
$wf->delete;
ok(!defined WebGUI::Workflow->new($session, $wfId), 'deleted workflow cannot be retrieved');