Lines 18-24
Link Here
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use DateTime::Duration; |
20 |
use DateTime::Duration; |
21 |
use Test::More tests => 91; |
21 |
use Test::More tests => 79; |
22 |
use Test::Warn; |
22 |
use Test::Warn; |
23 |
|
23 |
|
24 |
use t::lib::Mocks; |
24 |
use t::lib::Mocks; |
Lines 34-40
use Koha::Patrons;
Link Here
|
34 |
use Koha::Suggestions; |
34 |
use Koha::Suggestions; |
35 |
|
35 |
|
36 |
BEGIN { |
36 |
BEGIN { |
37 |
use_ok('C4::Suggestions', qw( GetSuggestion ModSuggestion GetSuggestionInfo GetSuggestionFromBiblionumber GetSuggestionInfoFromBiblionumber GetSuggestionByStatus ConnectSuggestionAndBiblio DelSuggestion MarcRecordFromNewSuggestion GetUnprocessedSuggestions DelSuggestionsOlderThan )); |
37 |
use_ok('C4::Suggestions', qw( GetSuggestion ModSuggestion GetSuggestionInfo GetSuggestionFromBiblionumber GetSuggestionByStatus ConnectSuggestionAndBiblio DelSuggestion MarcRecordFromNewSuggestion GetUnprocessedSuggestions DelSuggestionsOlderThan )); |
38 |
} |
38 |
} |
39 |
|
39 |
|
40 |
my $schema = Koha::Database->new->schema; |
40 |
my $schema = Koha::Database->new->schema; |
Lines 298-318
is( GetSuggestionFromBiblionumber(2), undef, 'GetSuggestionFromBiblionumber with
Link Here
|
298 |
is( GetSuggestionFromBiblionumber($biblio_1->biblionumber), $my_suggestionid, 'GetSuggestionFromBiblionumber functions correctly' ); |
298 |
is( GetSuggestionFromBiblionumber($biblio_1->biblionumber), $my_suggestionid, 'GetSuggestionFromBiblionumber functions correctly' ); |
299 |
|
299 |
|
300 |
|
300 |
|
301 |
is( GetSuggestionInfoFromBiblionumber(), undef, 'GetSuggestionInfoFromBiblionumber without the biblio number returns undef' ); |
|
|
302 |
is( GetSuggestionInfoFromBiblionumber(2), undef, 'GetSuggestionInfoFromBiblionumber with an invalid biblio number returns undef' ); |
303 |
$suggestion = GetSuggestionInfoFromBiblionumber($biblio_1->biblionumber); |
304 |
is( $suggestion->{suggestionid}, $my_suggestionid, 'GetSuggestionInfoFromBiblionumber returns the suggestion id correctly' ); |
305 |
is( $suggestion->{title}, $mod_suggestion1->{title}, 'GetSuggestionInfoFromBiblionumber returns the title correctly' ); |
306 |
is( $suggestion->{author}, $mod_suggestion1->{author}, 'GetSuggestionInfoFromBiblionumber returns the author correctly' ); |
307 |
is( $suggestion->{publishercode}, $mod_suggestion1->{publishercode}, 'GetSuggestionInfoFromBiblionumber returns the publisher code correctly' ); |
308 |
is( $suggestion->{suggestedby}, $my_suggestion->{suggestedby}, 'GetSuggestionInfoFromBiblionumber returns the borrower number correctly' ); |
309 |
is( $suggestion->{biblionumber}, $my_suggestion->{biblionumber}, 'GetSuggestionInfoFromBiblionumber returns the biblio number correctly' ); |
310 |
is( $suggestion->{STATUS}, $mod_suggestion3->{STATUS}, 'GetSuggestionInfoFromBiblionumber returns the status correctly' ); |
311 |
is( $suggestion->{surnamesuggestedby}, $member->{surname}, 'GetSuggestionInfoFromBiblionumber returns the surname correctly' ); |
312 |
is( $suggestion->{firstnamesuggestedby}, $member->{firstname}, 'GetSuggestionInfoFromBiblionumber returns the firstname correctly' ); |
313 |
is( $suggestion->{borrnumsuggestedby}, $my_suggestion->{suggestedby}, 'GetSuggestionInfoFromBiblionumeber returns the borrower number correctly' ); |
314 |
|
315 |
|
316 |
my $suggestions = GetSuggestionByStatus(); |
301 |
my $suggestions = GetSuggestionByStatus(); |
317 |
is( @$suggestions, 0, 'GetSuggestionByStatus without the status returns an empty array' ); |
302 |
is( @$suggestions, 0, 'GetSuggestionByStatus without the status returns an empty array' ); |
318 |
$suggestions = GetSuggestionByStatus('CHECKED'); |
303 |
$suggestions = GetSuggestionByStatus('CHECKED'); |
319 |
- |
|
|