Lines 15-21
use C4::Bookseller;
Link Here
|
15 |
use C4::Biblio; |
15 |
use C4::Biblio; |
16 |
use C4::Budgets; |
16 |
use C4::Budgets; |
17 |
use Koha::DateUtils; |
17 |
use Koha::DateUtils; |
18 |
use Test::More tests => 48; |
18 |
use Test::More tests => 49; |
19 |
|
19 |
|
20 |
BEGIN { |
20 |
BEGIN { |
21 |
use_ok('C4::Serials'); |
21 |
use_ok('C4::Serials'); |
Lines 173-179
is(C4::Serials::ModSubscriptionHistory(), undef, 'test modding subscription hist
Link Here
|
173 |
|
173 |
|
174 |
is(C4::Serials::ModSerialStatus(),undef, 'test modding serials'); |
174 |
is(C4::Serials::ModSerialStatus(),undef, 'test modding serials'); |
175 |
|
175 |
|
176 |
is(C4::Serials::findSerialByStatus(), 0, 'test finding serial by status with no parameters'); |
176 |
is(C4::Serials::findSerialsByStatus(), 0, 'test finding serial by status with no parameters'); |
|
|
177 |
|
177 |
is(C4::Serials::NewIssue(), undef, 'test getting 0 when nothing is entered'); |
178 |
is(C4::Serials::NewIssue(), undef, 'test getting 0 when nothing is entered'); |
178 |
|
179 |
|
179 |
is(C4::Serials::HasSubscriptionStrictlyExpired(), undef, 'test if the subscriptions has expired'); |
180 |
is(C4::Serials::HasSubscriptionStrictlyExpired(), undef, 'test if the subscriptions has expired'); |
Lines 219-225
for my $status ( @statuses ) {
Link Here
|
219 |
$counter++; |
220 |
$counter++; |
220 |
} |
221 |
} |
221 |
# Here we have 15 serials with statuses : 2*2 + 5*3 + 2*4 + 1*41 + 1*42 + 1*43 + 1*44 + 1*5 + 1*1 |
222 |
# Here we have 15 serials with statuses : 2*2 + 5*3 + 2*4 + 1*41 + 1*42 + 1*43 + 1*44 + 1*5 + 1*1 |
222 |
my @serialsByStatus = C4::Serials::findSerialByStatus(2,$subscriptionid); |
223 |
my @serialsByStatus = C4::Serials::findSerialsByStatus(2,$subscriptionid); |
223 |
is(@serialsByStatus,2,"findSerialByStatus returns all serials with chosen status"); |
224 |
is(@serialsByStatus,2,"findSerialByStatus returns all serials with chosen status"); |
224 |
( $total_issues, @serials ) = C4::Serials::GetSerials( $subscriptionid ); |
225 |
( $total_issues, @serials ) = C4::Serials::GetSerials( $subscriptionid ); |
225 |
is( $total_issues, @statuses + 1, "GetSerials returns total_issues" ); |
226 |
is( $total_issues, @statuses + 1, "GetSerials returns total_issues" ); |
Lines 247-250
for my $am ( @arrived_missing ) {
Link Here
|
247 |
} |
248 |
} |
248 |
is( $subscription->{missinglist}, join('; ', @serialseqs), "subscription missinglist is updated after ModSerialStatus" ); |
249 |
is( $subscription->{missinglist}, join('; ', @serialseqs), "subscription missinglist is updated after ModSerialStatus" ); |
249 |
|
250 |
|
|
|
251 |
my ( $expected_serial ) = GetSerials2( $subscriptionid, [1] ); |
252 |
#Find serialid for serial with status Expected |
253 |
my $serialexpected = (C4::Serials::findSerialsByStatus(1,$subscriptionid))[0]; |
254 |
#delete serial with status Expected |
255 |
C4::Serials::ModSerialStatus( $serialexpected->{serialid},$serialexpected->{serialseq},$publisheddate,$publisheddate, $publisheddate,'1','an useless note'); |
256 |
my @serialsByStatus = C4::Serials::findSerialsByStatus(1,$subscriptionid); |
257 |
is (@serialsByStatus,1,"ModSerialStatus delete corectly serial expected and create another if not exist"); |
258 |
# add 1 serial with status=Expected 1 |
259 |
C4::Serials::ModSerialStatus( $expected_serial->{serialid}, 'NO.20', $publisheddate, $publisheddate, $publisheddate, '1', 'an useless note' ); |
260 |
#Now we have two serials it have status expected |
261 |
#put status delete for last serial |
262 |
C4::Serials::ModSerialStatus( $serialexpected->{serialid},$serialexpected->{serialseq},$publisheddate,$publisheddate, $publisheddate,'1','an useless note'); |
263 |
#try if create or note another serial with status is expected |
264 |
@serialsByStatus = C4::Serials::findSerialsByStatus(1,$subscriptionid); |
265 |
is(@serialsByStatus,1,"ModSerialStatus delete corectly serial expected and not create another if exist"); |
266 |
|
250 |
$dbh->rollback; |
267 |
$dbh->rollback; |
251 |
- |
|
|