|
Lines 146-157
my $my_suggestion_with_budget2 = {
Link Here
|
| 146 |
budgetid => $budget_id, |
146 |
budgetid => $budget_id, |
| 147 |
}; |
147 |
}; |
| 148 |
|
148 |
|
| 149 |
is( CountSuggestion(), 0, 'CountSuggestion without the status returns 0' ); |
|
|
| 150 |
is( CountSuggestion('ASKED'), 0, 'CountSuggestion returns the correct number of suggestions' ); |
| 151 |
is( CountSuggestion('CHECKED'), 0, 'CountSuggestion returns the correct number of suggestions' ); |
| 152 |
is( CountSuggestion('ACCEPTED'), 0, 'CountSuggestion returns the correct number of suggestions' ); |
| 153 |
is( CountSuggestion('REJECTED'), 0, 'CountSuggestion returns the correct number of suggestions' ); |
| 154 |
|
| 155 |
my $my_suggestionid = NewSuggestion($my_suggestion); |
149 |
my $my_suggestionid = NewSuggestion($my_suggestion); |
| 156 |
isnt( $my_suggestionid, 0, 'NewSuggestion returns an not null id' ); |
150 |
isnt( $my_suggestionid, 0, 'NewSuggestion returns an not null id' ); |
| 157 |
my $my_suggestionid_with_budget = NewSuggestion($my_suggestion_with_budget); |
151 |
my $my_suggestionid_with_budget = NewSuggestion($my_suggestion_with_budget); |
|
Lines 168-176
is( $suggestion->{managedby}, undef, 'NewSuggestion stores empty string as undef
Link Here
|
| 168 |
is( $suggestion->{manageddate}, undef, 'NewSuggestion stores empty string as undef for date' ); |
162 |
is( $suggestion->{manageddate}, undef, 'NewSuggestion stores empty string as undef for date' ); |
| 169 |
is( $suggestion->{budgetid}, undef, 'NewSuggestion should set budgetid to NULL if not given' ); |
163 |
is( $suggestion->{budgetid}, undef, 'NewSuggestion should set budgetid to NULL if not given' ); |
| 170 |
|
164 |
|
| 171 |
is( CountSuggestion('ASKED'), 2, 'CountSuggestion returns the correct number of suggestions' ); |
|
|
| 172 |
|
| 173 |
|
| 174 |
is( ModSuggestion(), undef, 'ModSuggestion without the suggestion returns undef' ); |
165 |
is( ModSuggestion(), undef, 'ModSuggestion without the suggestion returns undef' ); |
| 175 |
my $mod_suggestion1 = { |
166 |
my $mod_suggestion1 = { |
| 176 |
title => 'my modified title', |
167 |
title => 'my modified title', |
|
Lines 226-232
$messages = C4::Letters::GetQueuedMessages({
Link Here
|
| 226 |
}); |
217 |
}); |
| 227 |
is( @$messages, 1, 'ModSuggestion sends an email if the status is updated' ); |
218 |
is( @$messages, 1, 'ModSuggestion sends an email if the status is updated' ); |
| 228 |
is ($messages->[0]->{message_transport_type}, 'email', 'When FallbackToSMSIfNoEmail syspref is disabled the suggestion message_transport_type is always email'); |
219 |
is ($messages->[0]->{message_transport_type}, 'email', 'When FallbackToSMSIfNoEmail syspref is disabled the suggestion message_transport_type is always email'); |
| 229 |
is( CountSuggestion('CHECKED'), 1, 'CountSuggestion returns the correct number of suggestions' ); |
|
|
| 230 |
|
220 |
|
| 231 |
#Check the message_transport_type when the 'FallbackToSMSIfNoEmail' syspref is enabled and the borrower has a smsalertnumber and no email |
221 |
#Check the message_transport_type when the 'FallbackToSMSIfNoEmail' syspref is enabled and the borrower has a smsalertnumber and no email |
| 232 |
t::lib::Mocks::mock_preference( 'FallbackToSMSIfNoEmail', 1 ); |
222 |
t::lib::Mocks::mock_preference( 'FallbackToSMSIfNoEmail', 1 ); |
|
Lines 400-407
my $del_suggestion = {
Link Here
|
| 400 |
}; |
390 |
}; |
| 401 |
my $del_suggestionid = NewSuggestion($del_suggestion); |
391 |
my $del_suggestionid = NewSuggestion($del_suggestion); |
| 402 |
|
392 |
|
| 403 |
is( CountSuggestion('CHECKED'), 3, 'CountSuggestion returns the correct number of suggestions' ); |
|
|
| 404 |
|
| 405 |
is( DelSuggestion(), '0E0', 'DelSuggestion without arguments returns 0E0' ); |
393 |
is( DelSuggestion(), '0E0', 'DelSuggestion without arguments returns 0E0' ); |
| 406 |
is( DelSuggestion($borrowernumber), '', 'DelSuggestion without the suggestion id returns an empty string' ); |
394 |
is( DelSuggestion($borrowernumber), '', 'DelSuggestion without the suggestion id returns an empty string' ); |
| 407 |
is( DelSuggestion(undef, $my_suggestionid), '', 'DelSuggestion with an invalid borrower number returns an empty string' ); |
395 |
is( DelSuggestion(undef, $my_suggestionid), '', 'DelSuggestion with an invalid borrower number returns an empty string' ); |
| 408 |
- |
|
|