|
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 => 79; |
21 |
use Test::More tests => 76; |
| 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( NewSuggestion GetSuggestion ModSuggestion GetSuggestionInfo GetSuggestionFromBiblionumber GetSuggestionByStatus ConnectSuggestionAndBiblio DelSuggestion MarcRecordFromNewSuggestion GetUnprocessedSuggestions DelSuggestionsOlderThan )); |
37 |
use_ok('C4::Suggestions', qw( NewSuggestion GetSuggestion ModSuggestion GetSuggestionInfo 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 284-294
is( $suggestion->{firstnamesuggestedby}, $member->{firstname}, 'GetSuggestionInf
Link Here
|
| 284 |
is( $suggestion->{borrnumsuggestedby}, $my_suggestion->{suggestedby}, 'GetSuggestionInfo returns the borrower number correctly' ); |
284 |
is( $suggestion->{borrnumsuggestedby}, $my_suggestion->{suggestedby}, 'GetSuggestionInfo returns the borrower number correctly' ); |
| 285 |
|
285 |
|
| 286 |
|
286 |
|
| 287 |
is( GetSuggestionFromBiblionumber(), undef, 'GetSuggestionFromBiblionumber without the biblio number returns undef' ); |
|
|
| 288 |
is( GetSuggestionFromBiblionumber(2), undef, 'GetSuggestionFromBiblionumber with an invalid biblio number returns undef' ); |
| 289 |
is( GetSuggestionFromBiblionumber($biblio_1->biblionumber), $my_suggestionid, 'GetSuggestionFromBiblionumber functions correctly' ); |
| 290 |
|
| 291 |
|
| 292 |
my $suggestions = GetSuggestionByStatus(); |
287 |
my $suggestions = GetSuggestionByStatus(); |
| 293 |
is( @$suggestions, 0, 'GetSuggestionByStatus without the status returns an empty array' ); |
288 |
is( @$suggestions, 0, 'GetSuggestionByStatus without the status returns an empty array' ); |
| 294 |
$suggestions = GetSuggestionByStatus('CHECKED'); |
289 |
$suggestions = GetSuggestionByStatus('CHECKED'); |
| 295 |
- |
|
|