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 => 92; |
22 |
use Test::More tests => 80; |
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 GetSuggestionInfoFromBiblionumber GetSuggestionByStatus ConnectSuggestionAndBiblio DelSuggestion MarcRecordFromNewSuggestion GetUnprocessedSuggestions DelSuggestionsOlderThan ) |
41 |
qw( ModSuggestion GetSuggestionInfo GetSuggestionByStatus ConnectSuggestionAndBiblio DelSuggestion MarcRecordFromNewSuggestion GetUnprocessedSuggestions DelSuggestionsOlderThan ) |
42 |
); |
42 |
); |
43 |
} |
43 |
} |
44 |
|
44 |
|
Lines 335-387
is(
Link Here
|
335 |
'GetSuggestionInfo returns the borrower number correctly' |
335 |
'GetSuggestionInfo returns the borrower number correctly' |
336 |
); |
336 |
); |
337 |
|
337 |
|
338 |
is( |
|
|
339 |
GetSuggestionInfoFromBiblionumber(), undef, |
340 |
'GetSuggestionInfoFromBiblionumber without the biblio number returns undef' |
341 |
); |
342 |
is( |
343 |
GetSuggestionInfoFromBiblionumber(2), undef, |
344 |
'GetSuggestionInfoFromBiblionumber with an invalid biblio number returns undef' |
345 |
); |
346 |
$suggestion = GetSuggestionInfoFromBiblionumber( $biblio_1->biblionumber ); |
347 |
is( |
348 |
$suggestion->{suggestionid}, $my_suggestionid, |
349 |
'GetSuggestionInfoFromBiblionumber returns the suggestion id correctly' |
350 |
); |
351 |
is( $suggestion->{title}, $mod_suggestion1->{title}, 'GetSuggestionInfoFromBiblionumber returns the title correctly' ); |
352 |
is( |
353 |
$suggestion->{author}, $mod_suggestion1->{author}, |
354 |
'GetSuggestionInfoFromBiblionumber returns the author correctly' |
355 |
); |
356 |
is( |
357 |
$suggestion->{publishercode}, $mod_suggestion1->{publishercode}, |
358 |
'GetSuggestionInfoFromBiblionumber returns the publisher code correctly' |
359 |
); |
360 |
is( |
361 |
$suggestion->{suggestedby}, $my_suggestion->{suggestedby}, |
362 |
'GetSuggestionInfoFromBiblionumber returns the borrower number correctly' |
363 |
); |
364 |
is( |
365 |
$suggestion->{biblionumber}, $my_suggestion->{biblionumber}, |
366 |
'GetSuggestionInfoFromBiblionumber returns the biblio number correctly' |
367 |
); |
368 |
is( |
369 |
$suggestion->{STATUS}, $mod_suggestion3->{STATUS}, |
370 |
'GetSuggestionInfoFromBiblionumber returns the status correctly' |
371 |
); |
372 |
is( |
373 |
$suggestion->{surnamesuggestedby}, $member->{surname}, |
374 |
'GetSuggestionInfoFromBiblionumber returns the surname correctly' |
375 |
); |
376 |
is( |
377 |
$suggestion->{firstnamesuggestedby}, $member->{firstname}, |
378 |
'GetSuggestionInfoFromBiblionumber returns the firstname correctly' |
379 |
); |
380 |
is( |
381 |
$suggestion->{borrnumsuggestedby}, $my_suggestion->{suggestedby}, |
382 |
'GetSuggestionInfoFromBiblionumeber returns the borrower number correctly' |
383 |
); |
384 |
|
385 |
my $suggestions = GetSuggestionByStatus(); |
338 |
my $suggestions = GetSuggestionByStatus(); |
386 |
is( @$suggestions, 0, 'GetSuggestionByStatus without the status returns an empty array' ); |
339 |
is( @$suggestions, 0, 'GetSuggestionByStatus without the status returns an empty array' ); |
387 |
$suggestions = GetSuggestionByStatus('CHECKED'); |
340 |
$suggestions = GetSuggestionByStatus('CHECKED'); |
388 |
- |
|
|