Lines 17-23
use Koha::Acquisition::Booksellers;
Link Here
|
17 |
use t::lib::Mocks; |
17 |
use t::lib::Mocks; |
18 |
use t::lib::TestBuilder; |
18 |
use t::lib::TestBuilder; |
19 |
use Test::MockModule; |
19 |
use Test::MockModule; |
20 |
use Test::More tests => 54; |
20 |
use Test::More tests => 55; |
21 |
|
21 |
|
22 |
BEGIN { |
22 |
BEGIN { |
23 |
use_ok('C4::Serials', qw( updateClaim NewSubscription GetSubscription GetSubscriptionHistoryFromSubscriptionId SearchSubscriptions ModSubscription GetExpirationDate GetSerials GetSerialInformation NewIssue AddItem2Serial DelSubscription GetFullSubscription PrepareSerialsData GetSubscriptionsFromBiblionumber ModSubscriptionHistory GetSerials2 GetLatestSerials GetNextSeq GetSeq CountSubscriptionFromBiblionumber ModSerialStatus findSerialsByStatus HasSubscriptionStrictlyExpired HasSubscriptionExpired GetLateOrMissingIssues check_routing addroutingmember GetNextDate )); |
23 |
use_ok('C4::Serials', qw( updateClaim NewSubscription GetSubscription GetSubscriptionHistoryFromSubscriptionId SearchSubscriptions ModSubscription GetExpirationDate GetSerials GetSerialInformation NewIssue AddItem2Serial DelSubscription GetFullSubscription PrepareSerialsData GetSubscriptionsFromBiblionumber ModSubscriptionHistory GetSerials2 GetLatestSerials GetNextSeq GetSeq CountSubscriptionFromBiblionumber ModSerialStatus findSerialsByStatus HasSubscriptionStrictlyExpired HasSubscriptionExpired GetLateOrMissingIssues check_routing addroutingmember GetNextDate )); |
Lines 552-557
subtest "NewSubscription|ModSubscription" => sub {
Link Here
|
552 |
is( $serials->next->biblionumber, $biblio_2->biblionumber, 'ModSubscription should have updated serial.biblionumber'); |
552 |
is( $serials->next->biblionumber, $biblio_2->biblionumber, 'ModSubscription should have updated serial.biblionumber'); |
553 |
}; |
553 |
}; |
554 |
|
554 |
|
|
|
555 |
subtest "test numbering pattern with dates in GetSeq GetNextSeq" => sub { |
556 |
plan tests => 4; |
557 |
$subscription = { |
558 |
lastvalue1 => 1, lastvalue2 => 1, lastvalue3 => 1, |
559 |
innerloop1 => 0, innerloop2 => 0, innerloop3 => 0, |
560 |
skip_serialseq => 0, |
561 |
irregularity => '', |
562 |
locale => 'C', # locale set to 'C' to ensure we'll have english strings |
563 |
firstaquidate => '1970-11-01', |
564 |
}; |
565 |
$pattern = { |
566 |
numberingmethod => '{Year} {Day} {DayName} {Month} {MonthName}', |
567 |
}; |
568 |
|
569 |
my $numbering = GetSeq( $subscription, $pattern ); |
570 |
is( $numbering, '1970 1 Sunday 11 November', 'GetSeq correctly calculates numbering from first aqui date' ); |
571 |
$subscription->{firstaquidate} = '2024-02-29'; |
572 |
|
573 |
$numbering = GetSeq( $subscription, $pattern ); |
574 |
is( |
575 |
$numbering, '2024 29 Thursday 2 February', |
576 |
'GetSeq correctly calculates numbering from first aqui date, leap year' |
577 |
); |
578 |
|
579 |
my $planneddate = '1970-11-01'; |
580 |
($numbering) = GetNextSeq( $subscription, $pattern, undef, $planneddate ); |
581 |
is( $numbering, '1970 1 Sunday 11 November', 'GetNextSeq correctly calculates numbering from planned date' ); |
582 |
$planneddate = '2024-02-29'; |
583 |
($numbering) = GetNextSeq( $subscription, $pattern, undef, $planneddate ); |
584 |
is( |
585 |
$numbering, '2024 29 Thursday 2 February', |
586 |
'GetNextSeq correctly calculates numbering from planned date, leap year' |
587 |
); |
588 |
|
589 |
}; |
590 |
|
591 |
|
555 |
subtest "_numeration" => sub { |
592 |
subtest "_numeration" => sub { |
556 |
|
593 |
|
557 |
plan tests => 6; |
594 |
plan tests => 6; |
558 |
- |
|
|