diff --git a/t/Workflow/Instance.t b/t/Workflow/Instance.t index 5a74fe272..08ff245bc 100644 --- a/t/Workflow/Instance.t +++ b/t/Workflow/Instance.t @@ -42,7 +42,7 @@ my $session = WebGUI::Test->session; #---------------------------------------------------------------------------- # Tests -plan tests => 11; # Increment this number for each test you create +plan tests => 12; # Increment this number for each test you create #---------------------------------------------------------------------------- # put your tests here @@ -80,9 +80,13 @@ cmp_ok(abs ($instance->get('lastUpdate')-$dateUpdated), '<=', 3, 'Date updated f my $otherInstance = WebGUI::Workflow::Instance->create($session, $properties); is ($otherInstance, undef, 'create: only allows one instance of a singleton to be created'); +WebGUI::Test->interceptLogging; + $instance->set({ 'parameters' => {session => 1}, }); $otherInstance = WebGUI::Workflow::Instance->create($session, {workflowId => $wf->getId, parameters => { session => 1,} }); is($otherInstance, undef, 'create: another singleton instance can not be created if it the same parameters as a currently existing instance'); +like($WebGUI::Test::logger_info, qr/An instance of singleton workflow \w{22} already exists/, 'create: Warning logged for trying to make another singleton'); + $otherInstance = WebGUI::Workflow::Instance->create($session, {workflowId => $wf->getId, parameters => { session => 2,}}); isnt ($otherInstance, undef, 'create: another singleton instance can be created if it has different parameters'); $otherInstance->delete;