Lines 365-371
$suggestion = GetSuggestion($my_suggestionid_test_budgetid);
Link Here
|
365 |
is( $suggestion->{budgetid}, undef, 'NewSuggestion Should set budgetid to NULL if equals an empty string' ); |
365 |
is( $suggestion->{budgetid}, undef, 'NewSuggestion Should set budgetid to NULL if equals an empty string' ); |
366 |
|
366 |
|
367 |
subtest 'GetUnprocessedSuggestions' => sub { |
367 |
subtest 'GetUnprocessedSuggestions' => sub { |
368 |
plan tests => 9; |
368 |
plan tests => 11; |
369 |
$dbh->do(q|DELETE FROM suggestions|); |
369 |
$dbh->do(q|DELETE FROM suggestions|); |
370 |
my $my_suggestionid = NewSuggestion($my_suggestion); |
370 |
my $my_suggestionid = NewSuggestion($my_suggestion); |
371 |
my $unprocessed_suggestions = C4::Suggestions::GetUnprocessedSuggestions; |
371 |
my $unprocessed_suggestions = C4::Suggestions::GetUnprocessedSuggestions; |
Lines 380-390
subtest 'GetUnprocessedSuggestions' => sub {
Link Here
|
380 |
$unprocessed_suggestions = C4::Suggestions::GetUnprocessedSuggestions; |
380 |
$unprocessed_suggestions = C4::Suggestions::GetUnprocessedSuggestions; |
381 |
is( scalar(@$unprocessed_suggestions), 1, 'GetUnprocessedSuggestions should return the suggestion if the suggestion is linked to a fund and has not been processed yet' ); |
381 |
is( scalar(@$unprocessed_suggestions), 1, 'GetUnprocessedSuggestions should return the suggestion if the suggestion is linked to a fund and has not been processed yet' ); |
382 |
|
382 |
|
383 |
ModSuggestion( { suggestionid => $my_suggestionid, STATUS => 'REJECTED' } ); |
383 |
warning_is { ModSuggestion( { suggestionid => $my_suggestionid, STATUS => 'REJECTED' } ) } |
|
|
384 |
'No suggestions REJECTED letter transported by email', |
385 |
'Warning raised if no REJECTED letter by email'; |
384 |
$unprocessed_suggestions = C4::Suggestions::GetUnprocessedSuggestions; |
386 |
$unprocessed_suggestions = C4::Suggestions::GetUnprocessedSuggestions; |
385 |
is( scalar(@$unprocessed_suggestions), 0, 'GetUnprocessedSuggestions should return the suggestion if the suggestion is linked to a fund and has not been processed yet' ); |
387 |
is( scalar(@$unprocessed_suggestions), 0, 'GetUnprocessedSuggestions should return the suggestion if the suggestion is linked to a fund and has not been processed yet' ); |
386 |
|
388 |
|
387 |
ModSuggestion( { suggestionid => $my_suggestionid, STATUS => 'ASKED', suggesteddate => dt_from_string->add_duration( DateTime::Duration->new( days => -4 ) ) } ); |
389 |
warning_is { ModSuggestion( { suggestionid => $my_suggestionid, STATUS => 'ASKED', suggesteddate => dt_from_string->add_duration( DateTime::Duration->new( days => -4 ) ) } ); } |
|
|
390 |
'No suggestions ASKED letter transported by email', |
391 |
'Warning raised if no ASKED letter by email'; |
388 |
$unprocessed_suggestions = C4::Suggestions::GetUnprocessedSuggestions; |
392 |
$unprocessed_suggestions = C4::Suggestions::GetUnprocessedSuggestions; |
389 |
is( scalar(@$unprocessed_suggestions), 0, 'GetUnprocessedSuggestions should use 0 as default value for days' ); |
393 |
is( scalar(@$unprocessed_suggestions), 0, 'GetUnprocessedSuggestions should use 0 as default value for days' ); |
390 |
$unprocessed_suggestions = C4::Suggestions::GetUnprocessedSuggestions(4); |
394 |
$unprocessed_suggestions = C4::Suggestions::GetUnprocessedSuggestions(4); |
391 |
- |
|
|