Lines 1-5
Link Here
|
1 |
use Modern::Perl; |
1 |
use Modern::Perl; |
2 |
use Test::More tests => 13; |
2 |
use Test::More tests => 17; |
3 |
|
3 |
|
4 |
use C4::Acquisition; |
4 |
use C4::Acquisition; |
5 |
use C4::Bookseller; |
5 |
use C4::Bookseller; |
Lines 135-140
is( exists $late_or_missing_issues[0]->{claimdate}, 1, 'GetLateOrMissingIssues r
Link Here
|
135 |
is( exists $late_or_missing_issues[0]->{claims_count}, 1, 'GetLateOrMissingIssues returns claims_count' ); |
135 |
is( exists $late_or_missing_issues[0]->{claims_count}, 1, 'GetLateOrMissingIssues returns claims_count' ); |
136 |
is( $late_or_missing_issues[0]->{claims_count}, 0, 'The issues should not habe been claimed yet' ); |
136 |
is( $late_or_missing_issues[0]->{claims_count}, 0, 'The issues should not habe been claimed yet' ); |
137 |
|
137 |
|
|
|
138 |
is( updateClaim(), undef, 'updateClaim should return undef if not param passed' ); |
138 |
my $serialid_to_claim = $late_or_missing_issues[0]->{serialid}; |
139 |
my $serialid_to_claim = $late_or_missing_issues[0]->{serialid}; |
139 |
updateClaim( $serialid_to_claim ); |
140 |
updateClaim( $serialid_to_claim ); |
140 |
|
141 |
|
Lines 144-149
is( scalar(@late_or_missing_issues), 2, 'supplier 2 should have 2 issues in late
Link Here
|
144 |
my ( $serial_claimed ) = grep { ($_->{serialid} == $serialid_to_claim) ? $_ : () } @late_or_missing_issues; |
145 |
my ( $serial_claimed ) = grep { ($_->{serialid} == $serialid_to_claim) ? $_ : () } @late_or_missing_issues; |
145 |
is( $serial_claimed->{claims_count}, 1, 'The serial should have been claimed' ); |
146 |
is( $serial_claimed->{claims_count}, 1, 'The serial should have been claimed' ); |
146 |
|
147 |
|
|
|
148 |
my @serials_to_claim = map { $_->{serialid} } @late_or_missing_issues; |
149 |
updateClaim( \@serials_to_claim ); |
150 |
@late_or_missing_issues = GetLateOrMissingIssues( $supplier_id2); |
151 |
is( scalar(@late_or_missing_issues), 2, 'supplier 2 should have 2 issues in late' ); |
152 |
|
153 |
( $serial_claimed ) = grep { ($_->{serialid} == $serials_to_claim[0]) ? $_ : () } @late_or_missing_issues; |
154 |
is( $serial_claimed->{claims_count}, 2, 'The serial should have been claimed' ); |
155 |
( $serial_claimed ) = grep { ($_->{serialid} == $serials_to_claim[1]) ? $_ : () } @late_or_missing_issues; |
156 |
is( $serial_claimed->{claims_count}, 1, 'The serial should have been claimed' ); |
157 |
|
158 |
|
147 |
my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); |
159 |
my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); |
148 |
# FIXME: This test should pass. The GetLateOrMissingIssues should not deal with date format! |
160 |
# FIXME: This test should pass. The GetLateOrMissingIssues should not deal with date format! |
149 |
#is( $serial_claimed->{claimdate}, $today, 'The serial should have been claimed today' ); |
161 |
#is( $serial_claimed->{claimdate}, $today, 'The serial should have been claimed today' ); |
150 |
- |
|
|