check the logging for duping a singleton
This commit is contained in:
parent
119e5d9645
commit
d43d06ea1a
1 changed files with 5 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue