Lines 1-8
Link Here
|
1 |
use Modern::Perl; |
1 |
use Modern::Perl; |
2 |
use Test::More tests => 17; |
2 |
use Test::More tests => 20; |
3 |
|
3 |
|
4 |
use C4::Acquisition; |
4 |
use C4::Acquisition; |
5 |
use C4::Budgets; |
5 |
use C4::Budgets; |
|
|
6 |
use C4::Serials; |
6 |
use Koha::Database; |
7 |
use Koha::Database; |
7 |
use Koha::Acquisition::Booksellers; |
8 |
use Koha::Acquisition::Booksellers; |
8 |
use_ok('C4::Serials'); |
9 |
use_ok('C4::Serials'); |
Lines 122-127
my $subscriptionid_inlate3 = NewSubscription(
Link Here
|
122 |
undef, undef, 0, undef, '2013-12-31', 0 |
123 |
undef, undef, 0, undef, '2013-12-31', 0 |
123 |
); |
124 |
); |
124 |
|
125 |
|
|
|
126 |
my $bibissn = '123456789'; |
127 |
my $biblioitem = Koha::Biblioitems->find({ 'biblionumber' => $biblionumber }); |
128 |
$biblioitem->set({ issn => $bibissn })->store; |
125 |
|
129 |
|
126 |
$supplierlist = GetSuppliersWithLateIssues(); |
130 |
$supplierlist = GetSuppliersWithLateIssues(); |
127 |
is ( scalar(@$supplierlist), 2, '2 suppliers should have issues in late'); |
131 |
is ( scalar(@$supplierlist), 2, '2 suppliers should have issues in late'); |
Lines 130-135
is( GetLateOrMissingIssues(), undef, 'GetLateOrMissingIssues should return undef
Link Here
|
130 |
|
134 |
|
131 |
my @late_or_missing_issues = GetLateOrMissingIssues( $supplier_id1 ); |
135 |
my @late_or_missing_issues = GetLateOrMissingIssues( $supplier_id1 ); |
132 |
is( scalar(@late_or_missing_issues), 1, 'supplier 1 should have 1 issue in late' ); |
136 |
is( scalar(@late_or_missing_issues), 1, 'supplier 1 should have 1 issue in late' ); |
|
|
137 |
is( $late_or_missing_issues[0]->{issn}, $bibissn, 'return of GetLateOrMissingIssues() contains biblioitems.issn'); |
133 |
|
138 |
|
134 |
@late_or_missing_issues = GetLateOrMissingIssues( $supplier_id2); |
139 |
@late_or_missing_issues = GetLateOrMissingIssues( $supplier_id2); |
135 |
is( scalar(@late_or_missing_issues), 2, 'supplier 2 should have 2 issues in late' ); |
140 |
is( scalar(@late_or_missing_issues), 2, 'supplier 2 should have 2 issues in late' ); |
Lines 162-164
is( $serial_claimed->{claims_count}, 1, 'The serial should have been claimed' );
Link Here
|
162 |
my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); |
167 |
my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); |
163 |
# FIXME: This test should pass. The GetLateOrMissingIssues should not deal with date format! |
168 |
# FIXME: This test should pass. The GetLateOrMissingIssues should not deal with date format! |
164 |
#is( $serial_claimed->{claimdate}, $today, 'The serial should have been claimed today' ); |
169 |
#is( $serial_claimed->{claimdate}, $today, 'The serial should have been claimed today' ); |
165 |
- |
170 |
|
|
|
171 |
@late_or_missing_issues = GetLateOrMissingIssues( undef, $subscriptionid_inlate1 ); |
172 |
is( scalar(@late_or_missing_issues), 1, 'subscription 1 should have 1 issue in late' ); |
173 |
is( $late_or_missing_issues[0]->{issn}, $bibissn, 'return of GetLateOrMissingIssues() contains biblioitems.issn'); |