Lines 19-25
use Modern::Perl;
Link Here
|
19 |
|
19 |
|
20 |
use DateTime::Duration; |
20 |
use DateTime::Duration; |
21 |
use Test::NoWarnings; |
21 |
use Test::NoWarnings; |
22 |
use Test::More tests => 80; |
22 |
use Test::More tests => 69; |
23 |
use Test::Warn; |
23 |
use Test::Warn; |
24 |
|
24 |
|
25 |
use t::lib::Mocks; |
25 |
use t::lib::Mocks; |
Lines 38-44
use Koha::Suggestions;
Link Here
|
38 |
BEGIN { |
38 |
BEGIN { |
39 |
use_ok( |
39 |
use_ok( |
40 |
'C4::Suggestions', |
40 |
'C4::Suggestions', |
41 |
qw( ModSuggestion GetSuggestionInfo GetSuggestionByStatus ConnectSuggestionAndBiblio DelSuggestion MarcRecordFromNewSuggestion GetUnprocessedSuggestions DelSuggestionsOlderThan ) |
41 |
qw( ModSuggestion GetSuggestionByStatus ConnectSuggestionAndBiblio DelSuggestion MarcRecordFromNewSuggestion GetUnprocessedSuggestions DelSuggestionsOlderThan ) |
42 |
); |
42 |
); |
43 |
} |
43 |
} |
44 |
|
44 |
|
Lines 310-340
$messages = C4::Letters::GetQueuedMessages( { borrowernumber => $borrowernumber2
Link Here
|
310 |
|
310 |
|
311 |
is( scalar(@$messages), 1, 'No new letter should have been generated if the update raised an error' ); |
311 |
is( scalar(@$messages), 1, 'No new letter should have been generated if the update raised an error' ); |
312 |
|
312 |
|
313 |
is( GetSuggestionInfo(), undef, 'GetSuggestionInfo without the suggestion id returns undef' ); |
|
|
314 |
$suggestion = GetSuggestionInfo($my_suggestionid); |
315 |
is( $suggestion->{suggestionid}, $my_suggestionid, 'GetSuggestionInfo returns the suggestion id correctly' ); |
316 |
is( $suggestion->{title}, $mod_suggestion1->{title}, 'GetSuggestionInfo returns the title correctly' ); |
317 |
is( $suggestion->{author}, $mod_suggestion1->{author}, 'GetSuggestionInfo returns the author correctly' ); |
318 |
is( |
319 |
$suggestion->{publishercode}, $mod_suggestion1->{publishercode}, |
320 |
'GetSuggestionInfo returns the publisher code correctly' |
321 |
); |
322 |
is( |
323 |
$suggestion->{suggestedby}, $my_suggestion->{suggestedby}, |
324 |
'GetSuggestionInfo returns the borrower number correctly' |
325 |
); |
326 |
is( |
327 |
$suggestion->{biblionumber}, $my_suggestion->{biblionumber}, |
328 |
'GetSuggestionInfo returns the biblio number correctly' |
329 |
); |
330 |
is( $suggestion->{STATUS}, $mod_suggestion3->{STATUS}, 'GetSuggestionInfo returns the status correctly' ); |
331 |
is( $suggestion->{surnamesuggestedby}, $member->{surname}, 'GetSuggestionInfo returns the surname correctly' ); |
332 |
is( $suggestion->{firstnamesuggestedby}, $member->{firstname}, 'GetSuggestionInfo returns the firstname correctly' ); |
333 |
is( |
334 |
$suggestion->{borrnumsuggestedby}, $my_suggestion->{suggestedby}, |
335 |
'GetSuggestionInfo returns the borrower number correctly' |
336 |
); |
337 |
|
338 |
my $suggestions = GetSuggestionByStatus(); |
313 |
my $suggestions = GetSuggestionByStatus(); |
339 |
is( @$suggestions, 0, 'GetSuggestionByStatus without the status returns an empty array' ); |
314 |
is( @$suggestions, 0, 'GetSuggestionByStatus without the status returns an empty array' ); |
340 |
$suggestions = GetSuggestionByStatus('CHECKED'); |
315 |
$suggestions = GetSuggestionByStatus('CHECKED'); |
341 |
- |
|
|